当前位置:网站首页>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
边栏推荐
- 小程序第三方微信授权登录的实现
- 重载和重写
- On site commissioning - final method of kb4474419 for win7 x64 installation and vs2017 flash back
- 生命原来如此脆弱
- Day4 branch and loop
- 电商借助小程序技术发力寻找增长突破口
- numpy.log
- A new explanation of tcp/ip five layer protocol model
- Detailed explanation of serial port communication principle 232, 422, 485
- COW读写复制机制在Linux,Redis ,文件系统中的应用
猜你喜欢

Redis多线程与ACL

kolla-ansible部署openstack yoga版本
![[C language] deep analysis of data storage in memory](/img/2e/ff0b5326d796b9436f4a10c10cfe22.png)
[C language] deep analysis of data storage in memory

423-二叉树(110. 平衡二叉树、257. 二叉树的所有路径、100. 相同的树、404. 左叶子之和)

pytorch(网络模型)

kolla-ansible部署openstack yoga版本

Getting started with Python

Class and object learning
Explore small program audio and video calls and interactive live broadcast from New Oriental live broadcast

工厂方法模式、抽象工厂模式
随机推荐
String类学习
项目中止
Redis底层数据结构
BOM document
Adapter mode
REUSE_ ALV_ GRID_ Display event implementation (data_changed)
Cyclic displacement
Combined mode, transparent mode and secure mode
Pytorch (environment, tensorboard, transforms, torchvision, dataloader)
Feelings of virtual project failure
工厂方法模式、抽象工厂模式
SQL query time period content
Explore small program audio and video calls and interactive live broadcast from New Oriental live broadcast
423-二叉树(110. 平衡二叉树、257. 二叉树的所有路径、100. 相同的树、404. 左叶子之和)
numpy.log
MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications
从新东方直播来探究下小程序音视频通话及互动直播
one billion two hundred and twelve million three hundred and twelve thousand three hundred and twenty-one
Machine learning 05: nonlinear support vector machines
小程序如何关联微信小程序二维码,实现二码聚合
