1 ERROR 2002(HY000): Can
1 ERROR 2002(HY000): Can't connect to local MySQL server through socket' /var/lib/mysql/mysql.sock'(2)
未啟動MySQL MySQL的問題
2 ERROR 1045(28000): Access denied for user 'root'@'localhost' (using password: NO)
密碼錯了,修改root用戶的密碼:
2.1 方法一
mysqladmin -uroot -ppassword 'newpassword'
2.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: <輸入新設的密碼newpassword>
3 Can'tconnect to MySQL server on '192.168.10.31' (10060)
IP寫錯了, 或者端口沒有開放.
4 ERROR 1130:Host '192.168.1.3' is not allowed to connect to this MySQL server
4.1 改表法
在localhost的那臺電腦,登入mysql后,更改"mysql"數(shù)據(jù)庫里的"user"表里的"host"項,,從"localhost"改成"%"
mysql -u root -p
mysql> use mysql;
mysql> update userset host = '%' where user = 'root';
mysql> select host,user from user;
4.2 授權(quán)法
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
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com