Description
A friend is using Ubuntu-server 16.04 to install MySQL, set up remote access when there is a problem, ask me to help. However, I have not used Ubuntu to install mysql, so I searched a lot of technical documents, than gourd painting scoop. However, due to the differences in the MySQL version, some problems occurred during the Setup setup: It is not possible to access remotely.
First, install MySQL
1. The installation needs to use the root account, if you do not set the root account, Google. In the process of installing MySQL, you need to set the password of the root account of MySQL, do not ignore it.
sudo apt-get install mysql-serverapt isntall mysql-clientapt Install Libmysqlclient-dev
2. After the installation of the above 3 packages, use the following command to query whether the installation was successful:
sudo netstat-tap | grep MySQL
The query results, as shown, indicate that the installation was successful.
[Email protected]:~# Netstat-tap | grep mysqltcp6 0 0 [::]:mysql [::]:* LISTEN 7510/mysqld
Second, set up MySQL remote access
1. Edit the MySQL configuration file, and put the bind-address = 127.0.0.1 comment
2. Use root to enter the MySQL command line, execute the following 2 commands, example of MySQL root account password: root
Grant all on * * to [e-mail protected] '% ' identified by ' root ' with grand Option;flush privileges;
3. Restart MySQL
/etc/init.d/mysql restart
Third, set account permissions
Authorization to the user
The user I use is the root password 123456
Example:
SQL code
GRANT all privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT OPTION;
After the execution, and then
Mysql:flush privileges;
Just refresh the permissions and don't restart.
Once the restart is successful, you can log on to the other computer.
Ubuntu MySQL installation and settings required for other hosts to connect to server MySQL (error:10061)