解決mysql數(shù)據(jù)庫(kù)設(shè)置遠(yuǎn)程連接權(quán)限執(zhí)行g(shù)rant all privileges on *.* to 'root'@'%' identified by '密碼' with grant optio報(bào)錯(cuò)
mysql數(shù)據(jù)庫(kù)設(shè)置遠(yuǎn)程連接權(quán)限,執(zhí)行g(shù)rant all privileges on *.* to 'root'@'%' identified by '密碼' with grant optio報(bào)錯(cuò)
ERROR1558 (HY000): Column count ofmysql.user is wrong. Expected 43, found 42. Created with MySQL 50556, now running 50639. Please use mysql_upgrade to fix this error.
解決辦法:
使用命令:mysql_upgrade -u[username] -p[password]
就可以解決。
使用mysql_upgrade
對(duì)數(shù)據(jù)庫(kù)的數(shù)據(jù)表結(jié)構(gòu)等升級(jí)時(shí),數(shù)據(jù)庫(kù)引擎MyISAM 會(huì)做檢查、修復(fù)的動(dòng)作,InnoDB 執(zhí)行 mysql_upgrade 沒(méi)有作用。
查找MySQL的安裝目錄找到mysql_upgrade :
- whereismysql_upgrade
- cd /usr/bin/
- ./mysql_upgrade -uroot -p123 (123為密碼)
然后進(jìn)入到mysql再執(zhí)行權(quán)限修改即可:grant all privileges on *.* to 'root'@'%' identified by 'root4xml004a' with grant option;
如:
mysql中遠(yuǎn)程連接權(quán)限語(yǔ)句grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘123456‘ with grant optio報(bào)錯(cuò)
grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘123456‘ with grant optio
原因: mysql的版本問(wèn)題,這條語(yǔ)句適用于MySQL8.0之前
解決: mysql8.0及以上版本需要使用以下語(yǔ)句:
create user root@'%' identified by '123456'; grant all privileges on *.* to root@'%' with grant option;
到此這篇關(guān)于解決mysql數(shù)據(jù)庫(kù)設(shè)置遠(yuǎn)程連接權(quán)限執(zhí)行g(shù)rant all privileges on *.* to 'root'@'%' identified by '密碼' with grant optio報(bào)錯(cuò)的文章就介紹到這了,更多相關(guān)mysql遠(yuǎn)程連接權(quán)限內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
VMware中Linux共享mysql數(shù)據(jù)庫(kù)的方法
VMware中Linux共享mysql數(shù)據(jù)庫(kù)的方法,需要的朋友可以參考下。2010-11-11mysql中g(shù)roup by與having合用注意事項(xiàng)分享
在mysql中g(shù)roup by分組查詢我們經(jīng)常會(huì)用到,并且還同時(shí)會(huì)與having合用,下面我介紹group by用法與having合用注意事項(xiàng),希望此教程對(duì)各位朋友有所幫助2013-10-10MySQL?數(shù)據(jù)類型及最優(yōu)選取規(guī)則
這篇文章主要介紹了MySQL?數(shù)據(jù)類型及最優(yōu)選取規(guī)則,文章圍繞主題展開(kāi)詳細(xì)的內(nèi)容介紹,具有一定的參考價(jià)值,需要的小伙伴可以參考一下,希望對(duì)你的學(xué)習(xí)有所幫助2022-08-08mysql中find_in_set()函數(shù)用法及自定義增強(qiáng)函數(shù)詳解
這篇文章主要給大家介紹了關(guān)于mysql中find_in_set()函數(shù)用法及自定義增強(qiáng)函數(shù)的相關(guān)資料,在MySQL 數(shù)據(jù)庫(kù)中進(jìn)行復(fù)雜的查詢語(yǔ)句,例如對(duì)多個(gè)字段進(jìn)行篩選和排序,文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下2024-06-06Mysql徹底解決中文亂碼問(wèn)題的方案(Illegal mix of collations for operation)
mysql數(shù)據(jù)庫(kù)和中文支持很不友好,經(jīng)常見(jiàn)到“Illegal mix of collations for operation”錯(cuò)誤,該如何解決呢?下面小編給大家?guī)?lái)了mysql數(shù)據(jù)庫(kù)中涉及到哪些字符集及徹底解決中文亂碼的解決方案,非常不錯(cuò),一起看看吧2016-08-08mysql通過(guò)find_in_set()函數(shù)實(shí)現(xiàn)where in()順序排序
這篇文章主要介紹了mysql通過(guò)find_in_set()函數(shù)實(shí)現(xiàn)where in()順序排序的相關(guān)內(nèi)容,具有一定參考價(jià)值,需要的朋友可以了解下。2017-10-10