MySQL View status
./mysqladmin-uroot-popen Extended-status
Then grep for Shell programming
Direct execution of EXTERNAL commands
./mysql-uroot-e "Show Master Status \g"
Parsing SQL statements
Explain <SQL>;
Explain partitions <SQL>;
View table Structure
DESC table name;
View the structure of creating a table
Show create table name;
View variables (configuration file)
Show variables like '%binlog_format% ';
View status (Run time)
Show status like '%conn% ';
MySQL Free login Execution command
Mysql-uroot-e "show slave status\g;"
MySQL Specifies a profile login
./bin/mysql--defaults-file=/root/mysql/my.cnf-uroot
Lock table
FLUSH TABLES with READ LOCK;
Unlock
UNLOCK TABLES;
MySQL debugging syntax
After the error, execute show warnings;
can see more information
Open root remote access, generally don't do this
Grant all privileges in *.* to ' root ' @ '% ' with GRANT OPTION;
Garbled
Command line login MySQL, view code
Show variables like '%character% '
Creating a Database
Create Database my_test;
Authorized
Grant all privileges on my_test.* to my_test@ '% ' identified by ' my_test_123 ';
Modify Root Password
Update Mysql.user Set Password=password (' Open ') where user= ' root ';
Flush privileges;
Backing up data (where you can manually specify the socket parameter--socket=/application/search/mysql/mysql/tmp/mysql.sock)
./mysqldump-uroot my_test-v >/data0/search/my_test.sql