A. First, add port 3306 to a security group, make sure that port is not Fengdiao
II. Mysql open permissions on the server, follow these steps
1.mysql>grant all privileges on *.* to 'root'@'%' identified by 'root';
(%) Represents all ip
The first one represents the root account
The second represents the root password
2.mysql>flush privileges;
3. Stop and restart the mysql service.
Stop command: service mysql stop
Start command: service mysql start
View status: service mysql status
If the above still can not access, then it should be mysql does not allow remote access.
Modify the configuration file:
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
the bind-address = 127.0.0.1 commented (i.e., the first line plus #), as follows:
code show as below:
INSTEAD of Skip-Networking # at The IS now default to the listen only ON
# localhost Which IS and IS not less compatible More Secure.
# The bind-address = 127.0.0.1
Then restart the service can be accessed.