在ubuntu14.04上安裝好mysql5.7以後,本地能夠鏈接mysql服務器。
遠程就不行。mysql
註釋掉在/etc/mysql/mysql.conf.d/mysqld.cnf裏面的bind-address = 127.0.0.1sql
# By default we only accept connections from localhost #bind-address = 127.0.0.1
若是還有問題,如Access denied for user ‘root’@’ip地址’ (using password: YES)ubuntu
mysql -uroot -p
輸入root用戶密碼,進入mysql服務器命令行 注意替換用戶的密碼服務器
use mysql; Grant all on *.* to 'root'@'%' identified by 'root用戶的密碼' with grant option; flush privileges;
而後用如下命令查看哪些用戶和host能夠訪問,%表明任意ip地址ide
select user,host from user;