1 error 2002 (hy000): Can't connect to local MySQL server through socket '/var/lib/MySQL. Sock' (2)
MySQL not started
2 error 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: No)
The password is incorrect. Modify the password of the root user:
2.1 Method 1
Mysqladmin-uroot-ppassword 'newpassword'
2.2 Method 2
#/Etc/init. d/MySQL stop
# Mysqld_safe -- user = MySQL -- skip-grant-tables -- skip-Networking &
# Mysql-u root MySQL
Mysql> Update userset Password = PASSWORD ('newpassword') where user = 'root ';
Mysql> flushprivileges;
Mysql> quit
#/Etc/init. d/mysqlrestart
# Mysql-uroot-P
Enter Password: <enter the new password newpassword>
3 can 'tconnect to MySQL server on '192. 168.10.31 '(192)
The IP address is wrong, or the port is not open.
4 error 1130: Host '192. 168.1.3 'is not allowed to connect to this MySQL Server
4.1 change table method
On the computer of localhost, log on to MySQL and change the "host" entry in the "user" table in the "MySQL" database to "%" from "localhost"
Mysql-u root-P
Mysql> use MySQL;
Mysql> Update userset host = '%' where user = 'root ';
Mysql> select host, user from user;
4.2 authorization Law
Mysql> grant all privilegeson *. * To 'yourname' @ '% 'identified by 'youpasswd ';
Query OK, 0 rowsaffected (0.05 Sec)
Mysql> flushprivileges;
Query OK, 0 rowsaffected (0.06 Sec)
Mysql> exit