System information (lsb_release -a)
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
sudo netstat -tap | grep mysql
sudo apt-get install mysql-server mysql-client
//server + clientsudo service mysql start
sudo netstat -tap | grep mysql
mysql -u root -p
type the passwordNecessary steps. If there is an error mysql.service failed because the control process exited with error code, check whether the path is correct. The paths of some articles seem to be different, maybe the system/version is different
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
modify bind-address=127.0.0.1
to bind-address=0.0.0.0
sudo service mysql restart
select user, host from user where user='root';
'%'
, %
in the host column is a wildcard. After modifying to %
, all IPs can be accessed. You can also specify the IP segment like this: 192.168.1.%
flush privileges;
//Refresh MySQL system privilege related tablesIf it is not set, an error message will be displayed: 1103 -Host '192.168.1.233' is not allowed to connect to this MySQL server
Download link: http://pan.baidu.com/s/1qXKpZgK
Server=192.168.1.233;Database=testdb;Uid=root;Pwd=123456;charset=utf8;pooling=true;
Recommended Posts