mysql -h 127.0.0.1 -P 3306 -u root -proot
docker exec -it root bash;
mysql -uroot -proot;
docker run -di --name=root -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root mysql:5.6
docker exec -it root bash;
mysql -uroot -proot;
CREATE USER 'root'@'%' IDENTIFIED BY 'root';
SET PASSWORD = PASSWORD('root');
update user set authentication_string=password('root') where user='root';
ALTER USER'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
SET PASSWORD = PASSWORD('root');
ALTER USER 'root' PASSWORD EXPIRE NEVER;
create user 'admin'@'%' identified by 'admin';
create user '新用户名'@'localhost' identified by '密码';
create user '新用户名'@'%' identified by '密码';
grant all privileges on 数据库名.表名 to '新用户名'@'指定ip' identified by '新用户密码' ;
grant all privileges on *.* to '新用户名'@'指定ip' identified by '新用户密码' ;
grant all privileges on test.test to '新用户名'@'指定ip' identified by '新用户密码' ;
grant all privileges on *.* to '新用户名'@'指定ip' identified by '新用户密码' WITH GRANT OPTION;
grant select on *.* to '新用户名'@'指定ip' identified by '新用户密码' WITH GRANT OPTION;
grant select,insert on *.* to '新用户名'@'指定ip' identified by '新用户密码' WITH GRANT OPTION;
REVOKE select ON what FROM '新用户名';
DROP USER username@localhost;
FLUSH PRIVILEGES;