Troubleshoot problems encountered when using MySQL
Problems encountered when using MySQL: 1 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql. sock '(2) MySQL not started Problem 2 ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: NO) the password is wrong, modify the root user password:
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 mysqlmysql> UPDATE userSET Password = PASSWORD ('newpassword ') where USER = 'root'; mysql> FLUSHPRIVILEGES; mysql> quit #/etc/init. d/mysqlrestart # mysql-uroot-pEnter password: <输入新设的密码newpassword> 3 Can 'tconnect to MySQL server on '100. the 168.10.31 '(10060) IP address is incorrect, 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 the table method on the localhost computer. after logging on to mysql, change the "host" entry in the "user" table in the "mysql" database, change from "localhost" to "%" mysql-u root-pmysql> use mysql; mysql> update userset host = '%' where user = 'root'; mysql> select host, user from user;
4.2 authorization method 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> exitbitsCN.com
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.