今天突然遠程登錄一下mysql發(fā)現(xiàn),新建數(shù)據(jù)庫時,出現(xiàn)Access denied for user ‘root‘@‘%to database ‘xxx‘
這是什么鬼,以前使用沒有問題呀???
然后就csdn一下
首先到文本登錄一下root用戶賬號
mysql -uroot -pxxxxx
重新給root%用戶授權(quán)一下
grant all privileges on *.* to 'root'@'%' identified by 'xxx此處為密碼xxx' with grant option;
執(zhí)行發(fā)現(xiàn),
?
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'root' with grant option' at line 1
?
我去,沒有辦法。從錯誤發(fā)現(xiàn)時從identified的地方開始報錯的,那干脆省略算了
grant all privileges on *.* to 'root'@'%'
發(fā)現(xiàn)果然好使,然后接著刷新權(quán)限文章來源:http://www.zghlxwxcb.cn/news/detail-724785.html
flush privileges;
ok,解決文章來源地址http://www.zghlxwxcb.cn/news/detail-724785.html
到了這里,關(guān)于解決Mysql的Access denied for user ‘root‘@‘%to database ‘xxx‘的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!