First, MySQL SQL processing business class
1.1. Calculate the Age by birthday
Select Date_format (From_days (To_days (now ())-to_days (' 1788-11-26 '), '%Y ') +0;
1.2, mysqladmin command Change password,-h specifies the IP of the database server
#/usr/mysql/bin/mysqladmin-h 192.168.0.%-uyangsq-p Password
Enter Password:
/usr/mysql/bin/mysqladmin:connect to server at ' 192.168.0.% ' failed
Error: ' Unknown MySQL Server Host ' 192.168.0.% ' (2) '
Check that mysqld are running on 192.168.0.% and that the port is 3306.
You can check the this by doing ' telnet 192.168.0.% 3306 '
#/usr/mysql/bin/mysqladmin-h 192.168.0.3-uyangsq-p Password
Enter Password:
New Password:
Confirm New Password:
1.3. Close multiple servers, you must connect to the specified port number
#/usr/mysql/bin/mysqladmin--port 3306 shutdown
1.4. Add a new field name behind a field in the table
ALTER TABLE stuscore add column ClassID int not null after course;
1.5. Multiple Table association Delete multiple tables
Delete t1,t2 from class T1 inner joins Stuscore T2 on T1.classid=t2.classid and T1.classid in (for each);
1.6. The server maintains many state variables that provide information about the operation. You can reset many state variables to 0 with the flush status statement.
Show status like '%thread% ';
Threads_connected: The number of connections that are currently open.
Threads_created: Creates the number of threads used to process the connection. If the threads_created is larger, you may want to increase the thread_cache_size value. The method of calculating the cache access rate is threads_created/connections.
Threads_running: The number of active (non-sleep) threads.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
MySQL Yun Koriyuki---knowledge accumulation