文章出處

1.用Navicat連接虛擬機下的mysql出現問題: 2003- Can't connect MySQL Server on '192.168.*.*'(10038).

解決方案:

方法:直接授權(推薦)

  從任何主機上使用root用戶,密碼:youpassword(你的root密碼)連接到mysql服務器:
  # mysql -u root -proot 
  mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;

2. 由于操作錯誤,再次登錄出現問題:“ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)”。

解決方案:

1、跳過密碼進行登錄

  修改mysql配置文件   在[mysqld]的段中加上兩句:

    skip-name-resolve   
    skip-grant-tables   

2. 登錄mysql,修改密碼

/usr/bin/mysql登入mysql

use mysql ;   
update mysql.user set authentication_string=password('root') where user='root';
flush privileges;   
quit 

3. 重啟mysql服務

  service mysql restart


文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜

    大師兄 發表在 痞客邦 留言(0) 人氣()