The following error occurred while starting MySQL:
[Root@www ~]#/usr/local/webserver/mysql/bin/mysqladmin-u root-p 12345678
Enter Password:
/usr/local/webserver/mysql/bin/mysqladmin:connect to server at ' localhost ' failed
Error: ' Can ' t connect to the local MySQL server through socket '/tmp/mysql.sock ' (111) '
Check that mysqld are running and that the socket: '/tmp/mysql.sock ' exists!
Workaround:
The code is as follows |
Copy Code |
[Root@www ~]#/usr/local/webserver/mysql/bin/mysql-u root-p-s/tmp/mysql.sock Enter Password: Welcome to the MySQL Monitor. Commands End With; or G. Your MySQL Connection ID is 3 Server Version:5.1.38-log Source Distribution Type ' help, ' or ' h ' for help. Type ' C ' to clear the current input statement. |
Mysql>
MySQL's parameter description:
/usr/local/webserver/mysql/bin/mysql–help | Less
List Common parameters:
-u,–user=name user for Login if not current user.
-p,–password[=name]
Password to use when connecting to server. If Password is
Not given it's asked from the TTY.
-s,–socket=name socket file to use for connection.
Another solution
I modified the value of the socket below the [mysqld] option through VIM/ETC/MY.CNF
The code is as follows |
Copy Code |
Socket=/var/lib/mysql/mysql.sock
|
Ok,mysqld can be activated.
Next, the MySQL boot is not, again, VIM/ETC/MY.CNF, added the following script:
[MySQL]
The code is as follows |
Copy Code |
Socket=/var/lib/mysql/mysql.sock |
Then, mysqladmin not start, or the same, under [mysqladmin] The socket value is set to the same path
OK, it's ready to start.