查看MySQL版本
mysql> select version();+------------+| version() |+------------+| 5.7.22-log |+------------+1 row in set (0.00 sec)
1、新建用户 创建test用户,密码是1234。
mysql -u root -pCREATE USER 'test'@'localhost' IDENTIFIED BY '1234'; #本地登录CREATE USER 'test'@'%' IDENTIFIED BY '1234'; #远程登录quitmysql -utest -p #测试是否创建成功
grant all privileges on wordpress.* to test@'%' identified by "123456"REVOKE ALL PRIVILEGES ON `wordpress`.* FROM 'test'@'%'; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER ON `wordpress`.* TO 'test'@'%';