2022年7月15日 星期五

mysql 授權root遠端存取

Mysql 5.7版為

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '!QAZ@WSX' WITH GRANT OPTION;

FLUSH PRIVILEGES;

exit


Mysql 8版為

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '!QAZ@WSX';

FLUSH PRIVILEGES;

exit


CREATE USER 'root'@'%' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;

GRANT ALL PRIVILEGES ON *.* to 'root'@'%';

FLUSH PRIVILEGES;

exit


沒有留言:

張貼留言