关于开启mysql远程访问连接命令

mysql

//赋予任何主机访问数据的权限 

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '自定义密码' WITH GRANT OPTION;

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

 

//指定ip地址访问权限

如:

配置192.168.16.130可以通过root:123456来访问数据库

GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.16.130'IDENTIFIED BY '123456' WITH GRANT OPTION;

 

一看大写就头疼,

grant all privileges on *.* to 'root' @'%' identified by '123456' with grant option;

 

刷新权限  

flush privileges;  

 

更新密码:

 update user set password=password('123456') where user='test';

 

 

 

词汇:

grant :(合法地)授予,允许;(勉强)承认,同意

privileges :特权;

identified : 被识别的;经鉴定的;被认同者

posted @ 2020-04-01 22:48  金鑫金  阅读(892)  评论(0编辑  收藏  举报