In the past two days, I want to start two different versions of MySQL on my computer at the same time. However, if the two versions of MySQL fail to be started, one of them may fail to start and become depressed. I cannot start it in either of the following ways:
I. The problem is as follows:
1, [root @ blackghost data] #/usr/local/MySQL/bin/mysqld_safe -- user = root -- skip-grant-tables
The prompt is as follows:
100910 22:31:44 mysqld_safe logging to '/usr/local/MySQL/master-error.log '.
100910 22:31:44 mysqld_safe starting mysqld daemon with databases from/usr/local/MySQL/Data
100910 22:31:44 mysqld_safe mysqld from PID file/usr/local/MySQL. PID ended
2. [root @ blackghost MySQL] #/usr/local/MySQL/share/MySQL. Server start
The prompt contains the following:
Starting mysql. Manager of PID-file quit without updating file. [failed]
Later, I found out that the reason for this was that I overwrote mysqld under the/MySQL installation directory/libexec. I thought mysqld in MySQL was similar, I did not expect that the mysqld under libexec is different, and the difference is big.
- [Root @ blackghost bin] # Du-SH mysqld
- 12 K mysqld
- [Root @ blackghost bin] # Du-Sh ../libexec/mysqld
- 6.1 m ../libexec/mysqld
Another file under libexec is mysqlmanager. I want to use mysqld here as a management object. I'm not sure what mysqld under libexec is, can anyone tell me? Thank you.
The mysqld of 12 K is a startup, stop, and other control script, which can be opened with VI, but the mysqld under libexec cannot be opened with VI and garbled characters are opened.
Ii. Solution
1. Because I have two different versions of MySQL, so I will test the mysqld under another libexec. I don't think there will be any problems.
2. After I tested mysqld under libexec, I still couldn't start it, and I still asked the error in question 1. I found a lot of ways on the Internet and there was a way to solve it, is to delete the/MySQL installation directory/data/mysql-bin.index, and then in
/Usr/local/MySQL/bin/mysqld_safe -- user = root -- skip-grant-tables
Then it starts.
3. prompt me when I use MySQL-u root-P
Error 2002 (hy000): Can't connect to local MySQL server through socket '/var/run/mysqld. Sock' (2)
However, the. Sock file in my. CNF is defined in/tmp/MySQL. Sock. How can I get there?
There are two ways to solve this problem
A), add a soft link, Ln-S/var/run/mysqld/MySQL. Sock/tmp/MySQL. Sock
B), MySQL-u root-p-S/tmp/MySQL. Sock