MySQL user management, common SQL statements, MySQL database backup recovery

Source: Internet
Author: User
MySQL User management

A new user who creates a specified IP can access some of the MySQL library's tables

. All tables for all libraries, if you want to specify access to certain tables of a library, you only need to modify the name
User1 specified user name br/>@ the IP that follows is the specified ip,% represents all IP

Verify login with User user1

You can also specify localhost,

You can access it without entering the native IP address at logon

View authorization to authorize new users, new permissions;

Common SQL statements

To view the number of rows in a library table
Search: Select count () from Mysql.user;

Search: Select db from Mysql.db;

Select Db,user from Mysql.db;

Fuzzy search Query Select
from mysql.db where host like ' 192.168.% ';

Insert: INSERT INTO DB1.T1 values (1, ' abc ');

Updated: Update db1.t1 set name= ' AAA ' where id=1;


Delete

Re-insert

Empty, empty content only, do not clear table structure
TRUNCATE TABLE db1.t1;

drop table db1.t1;
Drop database db1;

MySQL Database backup recovery

Start with a library to a directory, create a new library, and restore from the catalog to the new library

Backup table

Recovery table

Back Up all libraries

Back up table structure only

MySQL user management, common SQL statements, MySQL database backup recovery

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.