mysql backup:
docker exec container ID mysqldump -uroot -p password--databases library name> library name.sql
--Create user:
create user 'username'@'%' IDENTIFIED BY 'password';
--Create library:
create database if not exists database_name default character set = 'utf8';
--Authorize users with all permissions for a single library:
GRANT all ON database_name.* to [emailprotected]'%';
--Change user password:
ALTER USER 'root'@'%' IDENTIFIED BY 'mysql,.1q';--Cancel authorization:
revoke all on database_name.* from [emailprotected]'%';
--View user permissions:
show grants for username;
--Use Navicat Premium software to connect library test< /pre>
Note: When operating the mysql library to add, delete and modify the user, it is best to use the flush privileges command to refresh the privileges when the operation is completed. Otherwise, the modification may not take effect
docker exec container ID mysqldump -uroot -p password --databases library name> library name.sql
--Create user:
create user 'username'@'%' IDENTIFIED BY 'password';
--Create library:
create database if not exists database_name default character set = 'utf8';
--Authorize users with all permissions for a single library:
GRANT all ON database_name.* to [emailprotected]'%';
--Change user password:
ALTER USER 'root'@'%' IDENTIFIED BY 'mysql,.1q';--Cancel authorization:
revoke all on database_name.* from [emailprotected]'%';
--View user permissions:
show grants for username;
--Use Navicat Premium software to connect library test< /pre>
Note: When operating the mysql library to add, delete and modify the user, it is best to use the flush privileges command to refresh the privileges when the operation is completed. Otherwise, the modification may not take effect
-- Create user:
create user 'username'@'%' IDENTIFIED BY 'password';
--Create library:
create database if not exists database_name default character set = 'utf8';
--Authorize users with all permissions for a single library:
GRANT all ON database_name.* to [emailprotected]'%';
--Change user password:
ALTER USER 'root'@'%' IDENTIFIED BY 'mysql,.1q';--Cancel authorization:
revoke all on database_name.* from [emailprotected]'%';
--View user permissions:
show grants for username;
--Use Navicat Premium software to connect library test< /pre>