mysql8.0.15远程登陆权限,MySQL8.0给root用户赋予远程连接权限
1 問(wèn)題引入:直接使用“grant all privileges on *.* to 'root'@'%' with grant option;”給root用戶賦予可遠(yuǎn)程連接權(quán)限時(shí)報(bào)
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 '123456' WITH GRANT OPTION' at line 1 錯(cuò)誤
2 解決方案
use mysql;/*選中mysql數(shù)據(jù)庫(kù)*/
update user set host='%' where user ='root';/*修改庫(kù)中user表中,user用戶的host=%(任意連接)*/
flush privileges;/*重新加載權(quán)限表*/
grant all privileges on *.* to 'root'@'%' with grant option;/*給root用戶賦予遠(yuǎn)程連接權(quán)限*/
超強(qiáng)干貨來(lái)襲 云風(fēng)專訪:近40年碼齡,通宵達(dá)旦的技術(shù)人生總結(jié)
以上是生活随笔為你收集整理的mysql8.0.15远程登陆权限,MySQL8.0给root用户赋予远程连接权限的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: PHP artisan auth,Php
- 下一篇: php 特殊符号处理,处理特殊符号的方法