Mysql common command in Linux _ MySQL

Source: Internet
Author: User
Common mysql commands in Linux: bitsCN.com
Mysql command 1 in Linux: mysql can directly access the mysql command line. 2. for mysql database operations, you must first log on to mysql. the related operations are performed at the mysql prompt, and each command ends with a semicolon (;). 1. the database list is displayed. Show databases; 2. display the data table in the database: use mysql; // open the database show tables; 3. display the data table structure: describe table name; 4. create database name; 5. create a table: use database name; create table name (field setting list); 6. delete database and table: drop database name; drop table name; 7. clear the records in the table: delete from table name; 8. display the records in the table: select * from table name; 9. modify the encoding if you want to change the encoding format of mysql: when mysql is started, add the -- default-character-set = gbk to the mysqld_safe command line.
To change the encoding format of a database, enter the alter database db_name default character set gbk; bitsCN.com command at the mysql prompt.

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.