文章出處
文章列表
每次設置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
實用!
文章列表
全站熱搜