MySQL some commands

Source: Internet
Author: User

Show Processlist; View the list of service processes
Show engines; all supplied engines
Show variables like '%storage_engine% '; the current default storage engine
Show create table table name; see what engine the table uses.

show slave status\g; view from server status

---------------------------Log-related----------------------------------------
Linux, open the Bin-log log,
VI/ETC/MY.CNF, modify Log_bin=mysql-bin (name casual)


Flush logs; Will have one more up-to-date Bin-log log

Show master status; View information about the last Bin-log log

Reset Master; Clear all the Bin-log logs

Show binary logs; view log size
Show Binlog Events View Log additional information

Common parameters of Mysqlbinlog:
--stop-position = "--start-position" = "50" Restores the parameters you want to recover based on the starting position or end position
--stop-date= "2016-03-02 12:00:00"--start-date= "2016-03-02 11:55:00" restores the parameters you want to restore based on the start date time or end position

Use the Mysqlbinlog tool to display the binary results of the record, and then import it into a text file for later recovery.
The detailed procedure is as follows:
Bin>mysqlbinlog--start-position=4--stop-position=106 mysqlbin-log.000001 > D:\\test1.txt

or export all:
Bin>mysqlbinlog mysqlbin-log.000001 >d:\\test1.txt

To view the Bin-log log:
Mysqlbinlog--no-defaults mysql-bin.000002

Data recovery with Bin-log logs
Mysqlbinlog--no-defaults mysql-bin.000002|mysql-uroot-p Root

MySQL some commands

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.