What are the commonly used basic SQL statements in MYSQL? I don’t know if you know it. Today I will take you to review the commonly used SQL statements. Friends in need can refer to them.
net stop mysql --停止 net start mysql --启动
mysql -h localhost -u root -P 3306 -p mysql -h localhost -u root -p 123456
mysql>exit;
mysql>SHOW DATABASES;
mysql>CREATE { DATABASE | SCHEMA } [ IF NOT EXISTS ] db_name [DEFAULT] CHARACTER SET [ = ] charset_name; --创建 mysql>DROP DATABASE db_name; --删除
mysql>SHOW ENGINES; --查看存储引擎 mysql>USE db_name; --使用数据库 mysql>SELECT DATABASE(); --查看当前使用的数据库
mysql>USE db_name; --使用数据库 mysql>SHOW TABLES; --显示数据表
mysql>CREATE TABLE [IF NOT EXISTS] table_name(column_name column_type...) --创建 mysql>DROP TABLE table_name; --删除
mysql>DESC table_name; mysql>DESCRIBE table_name; mysql>EXPLAIN table_name; mysql>SHOW COLUMNS FROM table_name;
Related recommendations: "mysql tutorial"
The above is the detailed content of What are the commonly used basic SQL statements in MYSQL?. For more information, please follow other related articles on the PHP Chinese website!