Description
A friend asked me for help when installing MySQL with Ubuntu Server 16.04 to set up a remote access problem. However, I have not used Ubuntu to install MySQL, so search a lot of technical documents, than the gourd painting ladle. However, due to the differences in the MySQL version, there are some problems with the Setup setup: You cannot access it remotely.
First, install MySQL
1. The installation needs to use the root account, if you do not set the root account, please refer to other Linux commune articles. Install the MySQL process, you need to set the MySQL root account password, do not ignore.
sudo apt-get install mysql-server
apt isntall mysql-client
apt Install Libmysqlclient-dev
2. After the installation of the above 3 packages is complete, use the following command to inquire whether the installation was successful:
sudo netstat-tap | grep MySQL
The results of the query are shown in the following illustration to indicate a successful installation.
root@linuxidc.com:~# Netstat-tap | grep MySQL
tcp6 0 0 [::]:mysql [::]:* LISTEN 7510/mysqld
root@linuxidc.com:~#
Second, set MySQL remote access
1. Edit MySQL configuration file, put bind-address = 127.0.0.1 annotation
Vi/etc/mysql/mysql.conf.d/mysqld.cnf
2. Use root to enter the MySQL command line, execute the following 2 commands, in the example MySQL root account password: root
Grant all on *.* to root@ '% ' identified by ' root ' with the grand option;
Flush privileges;
3. Restart MySQL
/etc/init.d/mysql restart
Third, set account permissions
Give the user authorization
The user I use is the root password 123456
Example:
Grant all privileges in *.* to ' root ' @ '% ' identified by ' 123456 ' with Grant OPTION;
When you are done,
Refresh the permissions on it, no need to reboot
Once the reboot is successful, you can log on to another computer.
The above is a small series to introduce the Ubuntu Server 16.04 installation MySQL set up remote access problems of the perfect solution (error:10061), I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!