[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';