MySQL Remote login Settings command

Source: Internet
Author: User

mysql default off telnet permission , the following actions allow users to log in at any location:

1. Enter mysql,grant all privileges on * * to ' root ' @ '% ' identified by ' with GRANT Option;iden Tified by is followed by a password, which can be set to null.
2. FLUSH privileges; Update


MySQL for security, by default users are allowed to log on locally only, but in this case, you still need to use the user for remote connection, so that they can be remotely required to do the following:

Allow the root user to remotely log in anywhere and have any permissions to the library:
Log in to MySQL using the root user first:

Mysql-u root-p "Youpassword"
To authorize the operation:

mysql>grant All privileges on * * to ' root ' @ '% ' identified by ' Youpassword ' with GRANT OPTION;
Overload Authorization Table:

FLUSH privileges;
To exit the MySQL database:

Exit

Second, allow the root user to telnet in a specific IP, and have all the library operation permissions :
Log in to MySQL using the root user first:

Mysql-u root-p "Youpassword"
To authorize the operation:

GRANT All privileges on * * to [email protected]"172.16.16.152 "Identified by" Youpassword "with GRANT OPTION;
Overload Authorization Table:

FLUSH privileges;
To exit the MySQL database:

Exit

third, allow the root user to telnet in a specific IP, and have all library-specific operation rights :
Log in to MySQL using the root user first:

Mysql-u root-p "Youpassword"
To authorize the operation:

GRANT select,insert,update,delete on * . [email protected]"172.16.16.152 "Identified by" Youpassword ";
Overload Authorization Table:

FLUSH privileges;
To exit the MySQL database:

Exit

Iv. to remove user authorization, you need to use the REVOKE command:
REVOKE privileges on database [. Table name] from User-name;
For specific instances, first log in to MySQL:

Mysql-u root-p "Youpassword"
To authorize the operation:

GRANT select,insert,update,delete on test-db to [email protected]"172.16.16.152 "Identified by" Youpassword ";
Then delete the authorization action:

REVOKE all on test-db from Test-user;

****************************
Note: This action only clears the user's authorization rights for TEST-DB, but this "test-user" user still exists.

*****************************
Finally, clear the user from the user table:

DELETE from user WHERE user= "Test-user";
Overload Authorization Table:

FLUSH privileges;
To exit the MySQL database:

Exit

Five, MySQL permissions detailed classification:
         Global administrative permissions:
            file: Read and write files on the MySQL server.
            process: Displays or kills service threads belonging to other users.
            reload: Overloads the Access Control table, refreshes the log, and so on.
            shutdown: Turn off the MySQL service.

          Database/data table/Data column permissions:
             alter: Modifies existing data tables (such as Add/delete columns) and indexes.
            create: Create a new database or data table.
            delete: Deletes a record of the table.
            drop: Deletes a data table or database.
            index: Establishes or deletes an index.
            insert: Increase the record of the table.
            select: Displays/searches the table's records.
            update: Modifies a record that already exists in the table.

Special Permissions:
All: Allow to do anything (as root).
USAGE: Only allow login-nothing else is allowed.

MySQL Remote login Settings command

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.