Basic operation of "MySQL" Under DOS

Source: Internet
Author: User
Tags clear screen

Basic Operations View Help
(help?) \h    \?
Exit (Exit Quit)
\q
If you write the wrong command, you want to clear the statement of the current input command, and then add (clear) after the wrong command.
\c
Clear Screen
Cls

Database operations increase the database
Create DATABASE Db_name
Deleting a database
Drop Database Db_name
Modify Database
Cannot be modified
View Database
Show databases
Working with databases
 Use Db_name
To view the SQL statements for the build library
Show CREATE Database db_name;

Data table operations Add data table
CREATE table ' user ' (' id ' int (one) ', ' username ' varchar '), password varchar (32));
Delete a data table
DROP TABLE table_name
modifying data tables
rename new_table_name;
View a list of data tables
Show tables;
To view the SQL statement for the build table
Show CREATE TABLE table_name;

"Operation of table fields" increase or Decrease table field (First,after)
ALTER TABLE table_name ADD Table_field_first varchar (+) first;alter table table_name add table_field_second varchar ( ) after Table_field_first;
Delete a table field
ALTER TABLE table_name DROP Table_field;
Modify table field names to new fields
ALTER TABLE table_name change old_table_name new_table_name varchar (32);
Just modify a table field property
ALTER TABLE table_name MODIFY Table_field varchar (50);
View table Structure
DESC table_name

Basic operation of "MySQL" Under DOS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.