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


錯誤如圖:

場景,mysql8.0.17修改mysql用戶權限,開啟所有ip可訪問
使用:GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密碼' WITH GRANT OPTION;
報錯,原因是要先創建用戶再進行賦權,不能同時進行,所以我使用如下方法
使用mysql
use mysql
修改密碼:
ALTER USER 'root'@'localhost' IDENTIFIED BY '密碼';
修改ip為所有可訪問
update user set host='%' where user='root';
查看
select host,user from user;
刷新
flush privileges;

或者可以使用
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '密碼';
flush privileges;
navicat連接,ok
上面是修改root賬號,以下是新增一個賬號
create user 'test'@'localhost' identified by '密碼';
flush privileges;刷新權限
其中localhost指本地才可連接

可以將其換成%指任意ip都能連接

也可以指定ip連接(192.168.110.131)
也可以指定網段(192.168.110.%)
grant all privileges on *.* to 'test'@'localhost' with grant option;
flush privileges;
ok


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 Django進行數據遷移時,報錯:(1064, "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 '(6) NOT NULL)' at line 1") 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 '"id", 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 Mysql語法錯誤之> 1064 - 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' MySql 執行語句錯誤 Err] 1064 - 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 解決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 'order (order_name, customer) mybatis批量更新update-設置多個字段值 報錯 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 關於...corresponds to your MySQL server version for the right syntax to use near '?' at line 1的解決辦法 mysql版本:'for the right syntax to use near 'identified by 'password' with grant option' MySQL check the manual that corresponds to your MySQL server version for the right syntax錯誤
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM