Configure MySQL service ubuntu in Ubuntu
Step 1 install MySQL
Sudo apt-get install mysql-server
Step 2 configure MySQL
2.1 vim/etc/mysql/my. cnf find bind-address = 127.0.0.1.
2.2 comment out: # bind-address = 127.0.0.1
Or change the IP address to 0.0.0.0: bind-address = 0.0.0.0 to allow access from any IP address.
2.3 restart mysql: sudo/etc/inid. d/mysql restart
Step 3 authorize the user to connect remotely
3.1 log on to mysql: mysql-u root-p, and enter the password to log on
3.2 Authorization
Grant all privileges on *. * to root @ "%" identified by "password" with grant option;
Flush privileges;
The command on the first line is interpreted as follows, *. *: the first * indicates the database name, and the second * indicates the table name. This means that all tables in all databases are authorized to users. Root: Grant the root account. "%": Indicates that the authorized user's IP address can be specified. This indicates that any IP address can access the MySQL database."Password": password corresponding to the allocated account. replace the password with your mysql root account password.
The second command is to refresh the permission information, that is, to make the settings take effect immediately.