Ubuntu install MySQL

Source: Internet
Author: User
Tags flush mysql client

1. Install MySQL server, client and client development tools

sudo apt install mysql-server mysql-client libmysqlclient-dev

2. Setting up remote access MySQL

sudo vi/etc/mysql/mysql.conf.d/mysqld.cnf

Comment out bind-address = 127.0.0.1 this line, save exit Edit

Mysql-u root-p

Enter the MySQL service and enter the following command to allow any machine to access the MySQL server:

Law One: Modify the Permission method:

' Root '@'%'mypassword' with grant option; MySQL > Flush Privileges;

Law II: Modify the Table method:

Select host,user from user;

The results are as follows:

Mysql> select Host,user from user;
+-----------+------------------+
| Host | user |
+-----------+------------------+
| localhost | Debian-sys-maint |
| localhost | mysql.session |
| localhost | Mysql.sys |
| localhost | Root |
+-----------+------------------+
4 rows in Set (0.01 sec)

Change the host of user root to%:

mysql> Update user set host= '% ' where user= ' root ';

The results of the query are as follows:

Select host,user from user; +-----------+------------------+| Host      | user             |+-----------+------------------+|%         | root             | | localhost | debian-sys-maint | | localhost | Mysql.session    | | localhost | mysql.sys        |+-----------+------------------+4 in Set (  0.00 sec)

Make the changes effective:

mysql> flush Privileges;

3. Connect the MySQL service using the MySQL client GUI tool (NAVICAT)

Ubuntu install MySQL

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.