This article describes the examples of creating accounts, authorization, data export and import operations in MySQL database. Share with you for your reference, the details are as follows: 1. Account creation and authorization grant all privileges on *.* to 'yangxin'@'%' identified by 'yangxin123456' with grant option;
2. Check user permissions show grants for root; 3. Reclaim permissions revoke create on *.* from 'yangxin'; 4. Delete User drop user test; 5. Change password 1> Update mysql.user table # Before mysql5.7 update mysql.user set password=password('123456') where user='root'; # After mysql5.7 update mysql.user set authentication_string=password('123456') where user='root'; 2> Use the set password command grammar: set password for 'user name'@'login address'=password('password') 3>mysqladmin Syntax: mysqladmin -u username -p old password password new password Remember to refresh permissions: flush privileges; Data export: 1. Export structure but not data mysqldump -d database name -uroot -p > xxx.sql 2. Export data but not structure mysqldump -t database name -uroot -p > xxx.sql 3. Export data and table structure mysqldump database name -uroot -p > xxx.sql 4. Export the structure of a specific table mysqldump -uroot -p -B database name --table table name> xxx.sql #mysqldump [OPTIONS] database [tables] Import data: mysql -uroot -p database name < file name or: Then select the database to be imported: #use database; #source /tmp/xxx.sql Readers who are interested in more MySQL-related content can check out the following topics on this site: "Summary of MySQL Index Operation Skills", "Summary of MySQL Common Functions", "Summary of MySQL Log Operation Skills", "Summary of MySQL Transaction Operation Skills", "Summary of MySQL Stored Procedure Skills" and "Summary of MySQL Database Lock-Related Skills". I hope this article will be helpful to everyone's MySQL database design. You may also be interested in:
|
<<: How to implement web stress testing through Apache Bench
>>: Detailed steps to install Sogou input method on Ubuntu 20.04
Table of contents 1. Installation 2. There is no ...
This article shares the specific code of JS to ac...
Table of contents introduce Support Intel CPU Sup...
Table of contents Preface No.1 A focus No.2 Extra...
Starting and shutting down Tomcat under Linux In ...
System environment: Ubuntu 16.04LTS This article ...
1. Nginx installation steps 1.1 Official website ...
1. Download the alpine image [root@docker43 ~]# d...
This tutorial shares the process of manually inst...
Problem description (what is keep-alive) keep-ali...
Will UPDATE lock? Will the SQL statement be locke...
This article mainly introduces the implementation...
> Deploy MySQL 5.7 cluster master & slave ...
Table of contents Overview Object rest attribute ...
As shown below: XML/HTML CodeCopy content to clip...