Mysql common command sets (1/2)

Source: Internet
Author: User

Mysql tutorial common command set

Create database name; create database tutorial

Use databasename; select database

Drop database name directly deletes the database, no reminder

Show tables; displays tables

Describe tablename; Detailed description of the table

Add distinct to the select statement to remove duplicate fields.

Before mysqladmin drop databasename deletes a database, a message is displayed.

Display current mysql version and current date

Select version (), current_date;

2. Modify the root password in mysql:

Shell> mysql-u root-p

Mysql> update user set password = password ("xueok654123 ') where user = 'root ';

Mysql> flush privileges // refresh the database

Mysql> use dbname; open the database:

Mysql> show databases; displays all databases

Mysql> show tables; display all tables in mysql: use mysql first; then

Mysql> describe user; displays the column information of the user table in the mysql database );

3. grant

Create a full Super User that can connect to the server from anywhere, but you must use a password something to do this

Mysql> grant all privileges on *. * to user @ localhost identified by 'something' with1 2

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.