MySQL Command line client commands

Source: Internet
Author: User
Tags mysql command line

(after MySQL is installed and configured.)


One. Start or close the MySQL service


Start service: NET start database service name

Shutdown Service: net stop database service name

Attention:

    1. If you are already in mysql->, you cannot use the above two commands, use quit to exit this layer.

    2. The above two commands must be executed under a CMD window.



Two. Log in to the MySQL management system


Mysql-u User name-p password

If welcome to MySQL appears ... Indicates a successful database connection

Note: When executing commands under CMD, the command line does not need the lowercase ";" at the end. Semicolon.



Three. Create, view, delete, and use the database


To Create a database :

CREATE database name DEFAULT charset= ' UTF8 ';

For example:

Create Database student default charset= ' Utf-8 ';

Create a database student the default character encoding Utf-8


View all databases for this server:

show databases;


To delete a database:

Drop database name;


Use a database:

Use database name;


Show all the tables in the library:

Show tables;


Exit Current Connection

Quit





MySQL Command line client commands

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.