Enable remote access for mysql in linux

Source: Internet
Author: User

In linux, mysql enables the remote access function. 1. After mysql is successfully installed, the remote access permission is disabled by default, only the local database can access mysql. The default configuration is actually in the user table of the mysql user in the mysql database. You only need to modify the relevant records in this table for specific viewing methods, as shown in: 2. Add a new user for authorization # grant all privileges on *. * to created username @ "%" identified by "password"; # flush privileges; # refresh the content # format: grant permission on Database Name. table name to user @ login host identified by "User Password"; # @ is followed by the Client IP address (or host name) for accessing mysql) % represents any client # If localhost is set to local access (then this user cannot remotely access the mysql database ). 3. set remote access permissions for existing users # use mysql; # update db set host = '%' where user = 'username '; # If it is written as host = localhost, this user does not have the remote access permission # flush privileges; 4. view the modified result # use mysql; # select host, user, password from user;

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.