I plan to write some knowledge about database operations. Now I have finished the first article. The following describes the basic knowledge about mysql operations. In the window, start and stop the mysql service to start mysql Database net start mysql www.2cto.com stop mysql Database net stop mysql restart mysql Database net restart mysql command line form, use of mysql basic commands 1. Cancel the command \ c2, exit the mysql window exit; or quit; or ctrl + c 3. view the database version number select version (); 4. display the existing database show databases; www.2cto.com 5. select test database use test; 6. view the selected database select database (); 7. set the database Chinese encoding set names utf8; 8. create database test 9 and create table mtest (id tinyint (2) unsigned not null auto_increment, name varchar (20 ), sex char (1), email varchar (50), birth datetime, primary key (id); 10. insert a data insert into mtest ('name ', 'sex', 'email ', 'birth') values ('hangsan', '1', 'hangsan @ 163.com', now ()); www.2cto.com 11. Query Information in the mtest table where name is Zhang San. select * from mtest where name = 'hangsan '; 12. Output select * from mtest order by id desc in descending order of id; 13. select * from mtest id limit 10 to 20 data records displayed; Author: benpao