MySQL Common operations

Source: Internet
Author: User

Tag: MySQL grant select Drop Update.

show databases; See which libraries are available  

Use DB;  Show tables; View a table for a library

Desc TB; view the fields of a table  

Show CREATE TABLE tb\g; View the Build Table statement

Selectuser (); which user is currently

Select Database (); Current Library

Select version (); View Database Version

Showstatus; View MySQL Status

Set global max_connect_errors = 1000; modifying MySQL parameters

Show Processlist; View MySQL Queue

Grantall on * * to User1 identified by ' 123456 '; create a regular user and authorize  

Grant all on db1.* to ' user2 ' @ ' 10.0.2.100 ' identified by ' 111222 ';

Grant all on db1.* to ' User3 ' @ ' percent ' identified by ' 231222 '; (Percent semicolon '% ' indicates a wildcard)


select * from Tb1\g; Enquiry

Update tb1 set id=5 where name= ' 55 '; Update Data

TRUNCATE TABLE aming.tb1; empty table (library name . table name)

Delete from tb1 where name= ' 55 '; Delete the specified line

drop table tb1; Delete a table  

Drop database db1; Deleting a database

Repair table db1.tb1; Repair Table


This article is from the Linux OPS blog, so be sure to keep this source http://zhumy.blog.51cto.com/11647651/1793831

MySQL Common operations

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.