当前位置:网站首页>MySQL permission management and backup

MySQL permission management and backup

2022-06-11 10:03:00 Don't want to be a programmer

User management

Create user :create user user name identified by ' password '
Change Password ( The current user ):set password = password('12345')
Change Password ( Designated user ):set password for wanaei=password('111111')
rename :rename user wanaei to wanaeiHa

-- User authorization all privileges  All permissions , library , surface 
--all privilages  In addition to empowering others , Everything else can 
grant all privileges on *.* to wanaei

-- Query authority 
show grants for wanaei -- View the permissions for the specified user 
show grants for root@localhost

--root  User permissions :grant all privileges on *.* to 'root'@'locaohost' with grant option
-- Revoke authority  revoke  What authority , In which library , To whom 
revoke all privileges on *.* from wanaei

-- Delete user 
drop user wanaei

MySQL Backup

Ensure that important data is not lost
Data transfer

Backup :

  1. Copy out physical files directly
  2. stay Sqlyog Manually export... In this visualization tool
  3. Use the command line to export mysqlbump Command line
 mysqldump -hlocalhost -uroot -proot db student >F:a.sql

Import :
Command line ( Log on first :mysql -uroot -proot

- use shool
- source F:/a.sql

Prevent data loss

原网站

版权声明
本文为[Don't want to be a programmer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206111001156920.html