MySQL database management

Source: Internet
Author: User

MySQL Rights Management
    • The Rights management information is stored in,,,, user db and in host table_priv column_priv procs_priv the table
    • Through CREATE , DROP permissions can create new database/table, delete database/table
    • SELECT,,, to INSERT UPDATE increase the DELETE deletion of existing tables
    • INDEXAllow the creation and deletion of indexes on existing tables
MySQL Account management
    • Using GRANT statements
      e.g.:GRANT ALL PRIVILEGES ON *.* TO ‘monkey‘@‘localhost‘ IDENTIFIED BY ‘some_password‘ WITH GRANT OPTION;
      GRANT RELOAD,PROCESS ON *.* TO ‘admin‘@‘localhost‘;
      GRANTCommand interpretation: PRIVILEGES represents any permission, or the following can be SELECT / UPDATE ; ON Indicates which tables are affected, the preceding represents the database, and the subsequent representation table; TO Indicates which user is authorized, the previous user name, the following can fill IP,IP segment, hostname or% (for any), followed by the optional password of the specified user
    • Direct operation of the MySQL authorization form (user) Note that you can view the table structure before inserting and insert () at a time, DESCRIBE insert the password field to remember to PASSWORD(<密码>) encrypt, or insert failed; FLUSH PRIVILEGES Otherwise, changes to the authorization table will only be discovered if the server is restarted.
Remove user
    • DROP USER
Restricting user account Resources
    • You can restrict users to the following resources: 1. Number of queries issued per hour; 2. Number of updates issued per hour; 3. Number of servers that can be connected per hour
    • Use GRANT statements to implement resource constraints: In fact, the above statement in account management with a GRANT WITH clause can be, e.g.:GRANT ALL ON customer TO ‘admin‘@‘localhost‘ IDENTIFIED BY ‘some_password‘ WITH MAX_QUERIES_PER_HOUR 20 MAX_UPDATE_PER_HOUR 15 MAX_CONNECTIONS_PER_HOUR 20 MAX_USER_CONNECTION 10;
Modify User Password
    • To add a password for an existing user:mysqladmin -u root -h hostname password ‘new password‘;
    • Change Password:SET PASSWORD FOR ‘user‘@‘localhost‘ = PASSWORD(‘new password‘);
Database backup and Recovery
      • mysqldump/source

MySQL database management

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.