1. Install MySQL
A, install the service side
sudo apt-get install Mysql-server
B. Set Root user
sudo passwd
C, install the client
sudo apt-get install mysql-client
D. See if MySQL is installed successfully
sudo netstat-tap | grep MySQL
2. Configure Remote Access
A. Edit the configuration file
sudo vi/etc/mysql/mysql.conf.d/mysqld.cnf will bind-address = 127.0.0.1 comments
B. Modify user Permissions
Login Mysql:mysql-u root-p--Remote access mysql-h 192.168.0.201-p 3306-u root-p123 123 is the root user password
User rights: Grant all on * * to [email protected] '% ' identified by ' 1 '; --Add a remote access user with a username of root and a password of 1
Refresh: Flush privileges;
To see if the add succeeds: select user,host,authentication_string from User; --In 5.7 The user password is column authentication_string
Quit: Quit
C. Restart MySQL Service
/etc/init.d/mysql restart
3, complete and test pass.
Ps:
Attach VI editing points: Click I to enter the edit mode, press the ESC key to enter: wq! (Save and Exit VI edit mode)
MySQL Uninstall:
1, sudo apt-get autoremove--purge mysql-server-5.0
2, sudo apt-get remove mysql-server
3, sudo apt-get autoremove mysql-server
4, sudo apt-get remove Mysql-common-this is very important
5, Dpkg-l |grep ^rc|awk ' {print $} ' |sudo Xargs dpkg-p--clear residual data
Ubuntu16.04 installing MySQL and configuring remote access