MySQL Basic basic statement

Source: Internet
Author: User

Grant all privileges on * * to [e-mail protected] ' 192.168.200.% ' identified by ' Linwei '

Flush privileges;

Grant permissions on the database object. Table to user @ip identified by password

permissions : REPLICATION slace,replication CLIENT

database Object :*. * (*. * Description Database . ) Table name )

user : Shenge1 the % number is a wildcard character , which means that the user relp can 192.168.200.1~192.168.200.254 Service login password : Linwei


Mysql-u shenge1-h 192.168.200.157--password=linwei Login or-p manually enter the password

MySQL < 01.sql = write the MySQL statement in 01.sql and you can do so.

Mysql-u shenge1-h 192.168.200.157--password=linwei < 01.sql

Delete from Mysql.user where user= ' shenge1 '; Delete a user

show databases; display all databases

Show tables from MySQL; Displays all table names in the MySQL database

Create database student; Build a student

drop database student; Delete student databases

CREATE TABLE test.student (name Char,math int); Student table created in database test

drop table test.student; Delete the student table in the test database

Show Columns view table structure from table name or describe table name

Insert into test.student (Name,math) VALUES (' Xiaoming ', 87); Insert data

ALTER TABLE test.student drop name; remove the Name field.

ALTER TABLE Test.student add name (20), add name to this field

Update test.student set name= "Xiaoming" where math=78; updates the value of a data



This article is from the "12208412" blog, please be sure to keep this source http://12218412.blog.51cto.com/12208412/1878028

MySQL Basic basic statement

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.