Ubuntu Server 16.04 Install MySQL set up a perfect solution for remote access problems (error:10061) _linux

Source: Internet
Author: User
Tags flush mysql version mysql command line

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,

Mysql:flush privileges;

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.