本地连接CentOS云服务器的Mysql数据库

2017-03-29  本文已影响393人  Liumouren

1.首先在CentOS端进入数据库

mysql -u root -p"youpassword" 

2.进行授权操作

GRANT ALL PRIVILEGES ON 数据库名.表名 TO 'root'@'IP地址' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;
  GRANT ALL PRIVILEGES ON 数据库名.表名 TO 'root'@'111.111.111.111' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;
  GRANT ALL PRIVILEGES ON 数据库名.表名 TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;

3.重载授权表完成

FLUSH PRIVILEGES;
上一篇下一篇

猜你喜欢

热点阅读