MySQL common command set (1/2)

Source: Internet
Author: User

MySQL Tutorial common command set

Create database name; Create a database tutorial

Use DatabaseName; Select Database

Drop database name deletes databases directly, without alerting

Show tables; Show Table

Describe TableName; Detailed description of the table

Add distinct in Select to remove duplicate fields

Mysqladmin drop databasename Before you delete a database, you are prompted.

Display current MySQL version and current date

Select version (), current_date;

2, modify the MySQL root password:

Shell>mysql-u root-p

mysql> Update user Set Password=password ("xueok654123′) where user= ' root ';

Mysql> flush Privileges//Refresh Database

Mysql>use dbname; Open database:

Mysql>show databases; Show all databases

Mysql>show tables; Display all tables in database MySQL: use MySQL first;

Mysql>describe user; Displays the column information for the user table in the MySQL database of the table);

3. Grant

Create a complete superuser who can connect to the server from anywhere, but you must use a password something do this

Mysql> grant all privileges in *.* to user@localhost identified by ' something ' with

Home 1 2 last page

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.