[root@amos ~]# mysql -uroot -pmysql
mysql> use mysqlsql
# 增长受权(两种方式:第一种针对指定IP外网访问,第二种全部IP能够外网访问)
mysql> GRANT ALL PRIVILEGES ON . TO 'root'@'185.117.75.5' IDENTIFIED BY 'root';数据库
mysql> update user set Host = '%' where Host = 'localhost' and User = 'root';
# 刷新
mysql> flush privileges;spa
# 查询校验是否成功
mysql> select user,host from user;.net
4、科普下SQL意思对象
**权限:**所有权限:ALL 或者 ALL PRIVILEGES
详细:一共14个:select,insert,update,delete,
create,drop,index,alter,grant,references,reload,shutdown,process,fileget数据库对象:*.* 也就是全部数据库权限基础
用户:'root'@'...'date
**密码:**你懂得;file
(1)基础受权 + 无密码
(2)基础受权 + 有密码
(3)基础受权 + 有密码 + 该用户也能够受权(也可建立帐号)
eg. GRANT ALL PRIVILEGES ON . TO 'root'@'185.117.75.5' IDENTIFIED BY 'zztiEdu';