Ubuntu 16.04 set MySQL remote access permissions

Source: Internet
Author: User
Tags mysql command line root access

This article records remote access to the MySQL database set up under Ubuntu version 16.04.

First step: Modify the port bindings for the configuration file

The Open directory may be slightly different depending on the version of MySQL, you can first try to open/etc/mysql/my.cnf This configuration file, if the file does not exist or the file content is empty, try the following file path.

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

Add # At the beginning of the line below, comment out the line, and then save to exit Vim:

bind-address = 127.0.0.1
Step Two: Modify access permissions

Go to MySQL, enter the following command, enter the password and enter the MySQL command line

mysql -u root -p

Grant root access and refresh permissions, where root can be replaced by other MySQL users, and the PWD section should be replaced with the password for that user

grant all privileges on *.* to [email protected]"%" identified by "pwd" with grant option;flush privileges;exit;
Step three: Restart the MySQL service
service mysql restart

Note: The text editor used in this article is vim and can be edited using a graphical interface with other editors.

Ubuntu 16.04 set MySQL remote access permissions

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.