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
<br />"There are no ugly women in the w...
In actual development or production environments,...
Writing a Dockerfile Configure yum source cd /tmp...
For reference only for Python developers using Ub...
Main differences: 1. Type SQL databases are prima...
This article shares the specific code for JavaScr...
Table of contents What is MySQL NDB Cluster Preli...
Check what is installed in mysql rpm -qa | grep -...
Install MySQL database a) Download the MySQL sour...
When it comes to switching directories under Linu...
Table of contents 1. Insert 2. Update 3. Delete 1...
Brief description <br />In IE6 and 7, in a ...
useState useState adds some internal state to a c...
By default, the width and height of the table are...
I would like to ask a question. In Dreamweaver, I...