12th MySQL Advanced Management

Source: Internet
Author: User

1. After you manually update the permissions, you need to indicate to the server that the permissions have been modified:

Flush privileges (at the MySQL prompt);

2. View the permissions that the user has:

such as: show grants for Bookorama;

3. Get information about columns: DESCRIBE table [column];

4. Use explain to see how MySQL interprets and executes a select query;

5. Table optimization: OPTIMIZE table tablename;

6. Back up the MySQL database:

①lock tables Lock Some tables:

LOCK TABLES table Lock_type [, table Lock_type ...]

② command line: mysqldum–opt–all-databases > All.sql

Export all the content needed to rebuild a SQL database into a file named All.sql

After you stop the mysqld process, you can restart it by-log-bin

③ using the Mysqlhotcopy script:

Mysqlhotcopy Database/paht/for/backup

7. Recovery Mysqlshujuku:

① corresponding 6.① to perform the backup method, want to recover, just copy the data files to the same location where MySQL is installed;

② corresponds to 6.② performing a backup, the database recovery needs to first run the query in the export file (such as the all.sql above), which can rebuild the database to the state when the file was exported, and then update the database to the state saved in the binary log file.

Mysqlbinlog hostname-bin,[0-9]* | Mysql

8. Implement replication: master server, server architecture, binary logging, get snapshot.

12th MySQL Advanced 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.