当前位置:网站首页>MySQL-08
MySQL-08
2022-06-26 05:58:00 【Mr.Rop】
8、 Rights management and backup
8.1、 User management
SQLyog Visual management
SQL The command operation
User table :mysql.user
The essence : Add, delete, modify and check this table
-- Create user CREATE USER user name IDENTIFIED BY ' password ';
CREATE USER zourong IDENTIFIED BY '123456';
-- Change Password ( Change the current user password )
SET PASSWORD = PASSWORD('123456');
-- Change Password ( Change the specified user password )
SET PASSWORD FOR zourong=PASSWORD('123456')
-- rename RENAME USER Original name TO New name ;
RENAME USER zourong2 TO zourong;
-- User authorization ALL PRIVILEGES-> All permissions library . surface
-- ALL PRIVILEGES In addition to empowering others , Everything else can
GRANT ALL PRIVILEGES ON *.* TO zourong;
-- View permissions
SHOW GRANTS FOR zourong;
SHOW GRANTS FOR root@localhost;
-- ROOT User permissions :GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
-- Revoke authority REVOKE What authority , In which library , To whom
REVOKE ALL PRIVILEGES ON *.* FROM zourong;
-- Delete user
DROP USER zourong;
8.2、MySQL Backup
Why backup
- Ensure that important data is not lost
- Data transfer A—>B
MySQL Database backup mode
Copy physical files directly
stay SQLyog Manually export... In this visualization tool
- In the table or library you want to export , Right click , Select backup or export

Use the command line to export mysqldump Command line
# mysqldump -h host -u user name -p password database Table name > Physical disk location / file name mysqldump -hlocalhost -uroot -p123456 school student >D:/a.sql # mysqldump -h host -u user name -p password database surface 1 surface 2 surface 3 > Physical disk location / file name mysqldump -hlocalhost -uroot -p123456 school student result>D:/b.sql # mysqldump -h host -u user name -p password database > Physical disk location / file name mysqldump -hlocalhost -uroot -p123456 school>D:/c.sql # Import # In case of login , Switch to the specified database # source Backup file source D:/b.sql mysql -u user name -p123456 Library name < Backup file
Suppose you want to back up the database , Prevent data loss
Give the database to others ,sql Just give the document
边栏推荐
- Explore small program audio and video calls and interactive live broadcast from New Oriental live broadcast
- Status mode, body can change at will
- Soft power and hard power in program development
- Redis底层数据结构
- Operator priority, associativity, and whether to control the evaluation order [detailed explanation]
- Gram matrix
- Test depends on abstraction and does not depend on concrete
- 【C语言】深度剖析数据在内存中的存储
- 项目中止
- Interface oriented programming
猜你喜欢

DOM document

冒泡排序(Bubble Sort)

Unicloud cloud development obtains applet user openid

Getting started with Python

Cython入门

【C語言】深度剖析數據在內存中的存儲
Posting - don't get lost in the ocean of Technology
![Selective search for object recognition paper notes [image object segmentation]](/img/cf/d3b08d41083f37c164b26a96b989c9.png)
Selective search for object recognition paper notes [image object segmentation]

MySQL database-01 database overview

操作符的优先级、结合性、是否控制求值顺序【详解】
随机推荐
421-二叉树(226. 翻转二叉树、101. 对称二叉树、104.二叉树的最大深度、222.完全二叉树的节点个数)
5 minutes to learn regular expressions
Cyclic displacement
Bubble sort
Given two corresponding point sets AB, how to estimate the parameters of the specified transformation matrix R?
06. talk about the difference and coding between -is and = = again
How to use the tablet as the second extended screen of the PC
numpy. exp()
项目中止
劣币驱逐良币的思考
423-二叉树(110. 平衡二叉树、257. 二叉树的所有路径、100. 相同的树、404. 左叶子之和)
pytorch(网络模型)
循环位移
Day2- syntax basis and variables
Machine learning 07: Interpretation of PCA and its sklearn source code
Operator priority, associativity, and whether to control the evaluation order [detailed explanation]
旧情书
冒泡排序(Bubble Sort)
重载和重写
cross entropy loss = log softmax + nll loss
