Doc interface Operation Mysql:<br/>
Taking Phpstudy as an example
Login database: Enter Phpstudy/mysql/bin, mysql-u user name-p password
Select database: Use database name;
Set encoding format: set names GBK;
View table structure or field information: DESC table name;
CREATE DATABASE: Create database name Charset=utf8;
Delete the database: drop database name;
Modify database name: Export the database, create a new database, back up the database, or modify the database folder name under Mysql/data
Show all databases: show databases;
Build database tables: CREATE TABLE table name (field Name field type is blank (ID, set auto-grow, primary key), field Name 2 ...) Table Engine encoding format
Delete data table: drop table name;
Modify table name: ALTER TABLE name rename new table name;
View all tables: show tables;
Add Data table fields (columns): ALTER TABLE name add field name is empty;
Modify data table fields and field types is empty: ALTER TABLE name change old table name new table Name field type is empty;
Modify the Data table field type: ALTER TABLE name modify fields new data type
Delete data table fields: ALTER TABLE name drop field;
Insert data table data: INSERT into table name (field) VALUES (field corresponding value);
Delete data table data: Delete from table name (condition);
Empty data table: TRUNCATE TABLE name;
Modify the data table: The Update table name set field = new Value (where), and if not, all of the fields in the table have their values changed
View data table data: Select field name from table name (condition);
Database backup: Under Mysql/bin, command line: Mysqldump-u Username-p password database > file path and name after backup (e.g. E:/abc.sql)
Database restore: After logging into the database, create a new database and select the database, command line: Source file path to restore;
mysql-Database Operations