MYSQL remote logon permission settings

Source: Internet
Author: User

MYSQL remote logon permission settings Mysql disables remote logon by default. The following operations allow users to log on to any location: 1. go to mysql and grant all privileges on *. * TO 'root' @ '%' identified by ''with grant option; identified by is followed BY a password, which can be left blank. 2. FLUSH privilMysql disables remote logon by default. The following operations allow users to log on to any location: 1. go to mysql and grant all privileges on *. * TO 'root' @ '%' identified by ''with grant option; identified by is followed BY a password, which can be left blank. 2. FLUSH privileges; update Mysql to ensure security. By default, users are only allowed to log on locally. However, in this case, you still need to use the user for remote connection, therefore, to allow remote access, you need to perform the following operations: 1. Allow the root user to log on Remotely Anywhere and have any operation permissions on all databases. The specific operations are as follows: log ON to mysql: mysql-u root-p "youpassword" as the root user ON the local machine for authorization: mysql> grant all privileges on *. * TO 'root' @ '%' identified by 'youpassword' with grant option; overload authorization table: flush privileges; exit mysql database: exit 2. Allow the root user to log on remotely from a specific IP address and have any operation permissions on all databases. The specific operation is as follows: log on to mysql with the root user on the local machine first: m Ysql-u root-p "youpassword": grant all privileges on *. * TO root @ "172.16.16.152" identified by "youpassword" with grant option; overload authorization table: flush privileges; exit mysql database: exit 3. Allow the root user to remotely log on to mysql from a specific IP address and have specific database operation permissions. The specific operation is as follows: log on to mysql with the root user first on the local machine: mysql-u root-p "youpassword" for authorization: GRANT select, insert, update, delete ON *. * TO root @ "172.16.16.152" identified by "youpassword"; reload authorization table: flush privileges; Exit mysql database: exit 4. delete user authorization. Use the REVOKE command. The command format is REVOKE privileges ON database [. table name] FROM user-name; for a specific instance, log on to mysql: mysql-u root-p "youpassword" on the local machine for authorization: GRANT select, insert, update, delete ON TEST-DB TO test-user @ "172.16.16.152" identified by "youpassword"; delete authorization operation: REVOKE all on TEST-DB from test-user; *** note: this operation only clears the user's related permissions to the TEST-DB, but the user test-user still exists. Finally, clear the user FROM the user table: delete from user WHERE user = "test-user"; reload authorization table: flush privileges; exit mysql database: exit 5. MYSQL permission details: global Management permission: FILE: read and write files on the MySQL server. PROCESS: displays or kills service threads of other users. RELOAD: RELOAD Access Control tables and refresh logs. SHUTDOWN: Shut down the MySQL service. Database/data table/data column permissions: ALTER: Modify existing data tables (such as adding/deleting columns) and indexes. CREATE: CREATE a new database or data table. DELETE: DELETE table records. DROP: delete a data table or database. INDEX: Create or delete an INDEX. INSERT: Add Table records. SELECT: displays/searches for table records. UPDATE: Modify existing records in the table. Special permissions: ALL: allow to do anything (same as root ). USAGE: Only logon is allowed. Other operations are not allowed.

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.