Solved

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

Posted on 2008-11-01
2
245 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

729 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