Ubuntu 16.04 install MySQL and set up remote access

Source: Internet
Author: User
Tags mysql command line

Turn from (http://www.cnblogs.com/iscodercn/p/5488633.html), there are supplements

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 install mysql-serverapt install 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

[Email protected]:~# mysql-uroot-proot

Grant all on * * to [e-mail protected] '% ' identified by ' root ' with grant Option;flush privileges;
Exit (Exit)

*. *: The first * represents the database name; the second * represents the table name. This means that all tables in the database are licensed to the user. Root: Grant root account. "%": indicates that the authorized user IP can be specified,

This means that any IP address can access the MySQL database. "Password": Assign the password of the account, here the password itself is replaced with your MySQL root account password.

3. Restart MySQL

/etc/init.d/mysql restart

Once the restart is successful, you can log on to the other computer.

Ubuntu 16.04 install MySQL and set up remote access

Related Article

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.