Solved

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

Posted on 2008-11-01
2
244 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Creating and Managing Databases with phpMyAdmin in cPanel.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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…

730 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