文章出處

每次設置root和遠程訪問都容易出現問題, 總結了個通用方法, 關鍵在于實用

 

step1:

# mysql -u root mysql  

mysql> Grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option; //增加遠程訪問權限
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;  

  //增加root密碼,如果修改密碼時報錯, Unknown column 'password' in 'field list',改為update user set authentication_string=password('123456') where user='root'


mysql> FLUSH PRIVILEGES;  
mysql> quit  
# /etc/init.d/mysql restart  
# mysql -uroot -p  

 

step2:

在ubuntu上可以

修改

/etc/mysql/mysql.conf.d/mysqld.cnf

的 bind-address          = 127.0.0.1   這一行注釋掉即可

 

step3:

# /etc/init.d/mysql restart  

 

QQ 107966750

 

 

實用!

 

 

 


文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

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