当前位置:网站首页>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
边栏推荐
- 05. basic data type - Dict
- Feelings of virtual project failure
- REUSE_ALV_GRID_DISPLAY 事件实现(DATA_CHANGED)
- What management systems (Updates) for things like this
- 操作符的优先级、结合性、是否控制求值顺序【详解】
- Posting - don't get lost in the ocean of Technology
- Life is so fragile
- 劣币驱逐良币的思考
- Machine learning 07: Interpretation of PCA and its sklearn source code
- 状态模式,身随心变
猜你喜欢
随机推荐
劣币驱逐良币的思考
numpy.log
冒泡排序(Bubble Sort)
Cyclic displacement
RIA ideas
Win socket programming (Mengxin initial battle)
小程序如何关联微信小程序二维码,实现二码聚合
numpy.frombuffer()
【C语言】深度剖析数据在内存中的存储
[intra group questions semester summary] some reference questions for beginners
Thinking about bad money expelling good money
About XXX management system (version C)
Customize WebService as a proxy to solve the problem of Silverlight calling WebService across domains
REUSE_ALV_GRID_DISPLAY 事件实现(DATA_CHANGED)
Machine learning 05: nonlinear support vector machines
Easy to understand from the IDE, and then talk about the applet IDE
Getting started with Python
售前分析
一段不离不弃的爱情
C generic speed









