当前位置:网站首页>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
边栏推荐
- Overloading and overriding
- Pytorch (network model)
- 421- binary tree (226. reversed binary tree, 101. symmetric binary tree, 104. maximum depth of binary tree, 222. number of nodes of complete binary tree)
- 一段不离不弃的爱情
- Source code of findcontrol
- A new journey
- pytorch(网络模型训练)
- Vs2022 offline installation package download and activation
- tf.nn.top_k()
- 从新东方直播来探究下小程序音视频通话及互动直播
猜你喜欢

Unicloud cloud development obtains applet user openid

工厂方法模式、抽象工厂模式

421-二叉树(226. 翻转二叉树、101. 对称二叉树、104.二叉树的最大深度、222.完全二叉树的节点个数)

Detailed explanation of serial port communication principle 232, 422, 485

Household accounting procedures (First Edition)

【群内问题学期汇总】初学者的部分参考问题
从新东方直播来探究下小程序音视频通话及互动直播

Getting started with Python

卷妹带你学jdbc---2天冲刺Day2

423- binary tree (110. balanced binary tree, 257. all paths of binary tree, 100. same tree, 404. sum of left leaves)
随机推荐
旧情书
ES6的搭配环境
A new explanation of tcp/ip five layer protocol model
Feelings of virtual project failure
Bingc (inheritance)
C generic speed
小程序如何关联微信小程序二维码,实现二码聚合
Kolla ansible deploy openstack Yoga version
生命原来如此脆弱
numpy.tile()
虚拟项目失败感想
SQL Server 函数
On site commissioning - final method of kb4474419 for win7 x64 installation and vs2017 flash back
Application of cow read / write replication mechanism in Linux, redis and file systems
Something about MariaDB
Thinking about bad money expelling good money
Class and object learning
What management systems (Updates) for things like this
Adapter mode
最后一次飞翔
