Solved

how to by shell connect to 2 mysql server in same server

Posted on 2008-11-01
2
241 Views
Last Modified: 2012-05-05
I have 2 mysql start in same server.
one to port 3306 and socket /tmp/mysql.sock
one to port 3308 and socket /tmp/mysql2.sock

I want can connect with script shell to mysql1 or mysql2

how to by shell connect to 2 mysql in same server ?
0
Comment
Question by:thierry91
2 Comments
 
LVL 39

Accepted Solution

by:
Roger Baklund earned 500 total points
ID: 22857059
You can use the --port command line parameter to specify what port to connect to, or --socket to specify the socket:

mysql --port=3308
mysql --socket=/tmp/mysql2.sock

To see all possible command line parameters, use:

mysql --help
0
 
LVL 1

Author Comment

by:thierry91
ID: 22857096
thank you,
mysql --port=3308   // not work

mysql --socket=/tmp/mysql2.sock   // work fine

cordially
thierry
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Utilizing an array to gracefully append to a list of EmailAddresses
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now