Centos7 操作系統: mysql5.7 配置遠程登陸操作:
首先登陸服務器,進入數據庫:
mysql -u root -p

show databases;

use mysql;

show tables;

#Field 'ssl_cipher' doesn't have a default value ;
創建用戶時候報錯:
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
解決辦法:
//設置安全級別
set global validate_password_policy=0;
//設置最小長度
set global validate_password_length=4;
#desc user;
create user yang IDENTIFIED by '123456';

select User ,authentication_string,Host from user;

重要步驟:給新建的用戶進行授權 並且可遠程訪問
grant all privileges on *.* to 'yang'@'%' with grant option;
flush privileges;
---------
注意: (1)"%"欲連接到此Mysql數據庫的客戶端的IP地址,根據需求進行修正即可。%表示全部ip均可連接
(2)password就是Mysql數據庫test用戶的password,根據實際情況需要修改
修改MySQL的配置文件
/etc/mysql/my.cnf文件,找到bind-address = 127.0.0.1
將 bind-address = 127.0.0.1 這一行注釋掉, 即修改為:
#bind-address = 127.0.0.1
最后:
centos之前的版本的操作命令不一樣
將MySQL服務進行重啟
service mysqld restart
service mysqld status
centos7
systemctl status mysqld.service
查看狀態
systemctl restart mysqld.service
重啟
參考文章:
http://www.cnblogs.com/yoursoul/p/6264059.html
