CMD under the mysql operation command Daquan detailed

Source: Internet
Author: User

Start: net start mySql;

Enter: Mysql-u root-p/mysql-h localhost-u root-p databaseName;

List databases: show databases;

Select database: Use DatabaseName;

List table: Show tables;

Show table Column properties: Show columns from TableName;

Build database: Source FileName.txt;

Match characters: You can use wildcard characters _ to represent any one character, and% to represent any string;

Add a field: ALTER TABLE tabelname add column FieldName datetype;

Add multiple fields: ALTER TABLE tabelname add column fieldName1 datetype,add columns fieldName2 datetype;

Multi-line command input: Note that you cannot break the word, and when inserting or changing data, you cannot expand the string of the field into multiple lines, or the hard return will be stored in the data;

Add an Administrator account: Grant all on * * to [e-mail protected] identified by "password";

Fill in the end of each statement with a semicolon '; ', or add ' \g ' to it;

Query time: Select Now ();

Query Current User: Select User ();

Querying database version: Select version ();

Querying the database currently in use: s

Related Article

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.