1、启动后关闭问题:
[root@localhost dbdata_3306]# /data/dbdata_3306/mysqld stop
Stoping MySQL...
/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'admin'@'localhost' (using password: YES)'
解决方法:
[root@localhost dbdata_3306]# /usr/local/mysql/bin/mysql -u root -p -S /data/dbdata_3306/mysql.sock
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.60-log Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> GRANT SHUTDOWN ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
[root@localhost dbdata_3306]# /data/dbdata_3306/mysqld stop
Stoping MySQL...
[root@localhost dbdata_3306]# /data/dbdata_3306/mysqld restart
Stoping MySQL...
/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/data/dbdata_3306/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/data/dbdata_3306/mysql.sock' exists!
Starting MySQL...
[root@localhost dbdata_3306]# /data/dbdata_3306/mysqld restart
Stoping MySQL...
Starting MySQL...
[root@localhost dbdata_3306]#