mysql>grant select on *.* to read@'%' identified by 'j'; //给予read用户只读全部库的权限 mysql>grant select,delete,update,create,drop on *.* to test@"%" identified by "1234"; //test用户对所有数据库都有select,delete,update,create,drop 权限. mysql>flu…
1.开通操作权限和表权限 GRANT CREATE,ALTER,DROP,INSERT,UPDATE,DELETE,SELECT ON interface.* TO test1@'%' identified by 'test' WITH GRANT OPTION; GRANT all ON interface.* TO test1@'%' identified by 'test' WITH GRANT OPTION; 2.移除权限 REVOKE select,CREATE,ALTER,DROP…
方法1 :使用mysql root(root权限)用户登陆直接赋权也能够创建用户 /usr/bin/mysqladmin -u root password 123456 mysql -uroot -p password 查看全部username与password select host ,user ,password from user; grant all on ec.* to 'root'@'%' identified by '123456'; grant all privileges o…
INSERT INTO mysql.user(HOST,USER,authentication_string,ssl_cipher,x509_issuer,x509_subject,select_priv) VALUES('192.168.60.%','hzx',PASSWORD('123'),'','','','Y'); UPDATE USER SET authentication_string=PASSWORD("123") WHERE USER="hzx";…
说明: slow_query_log 慢查询开启状态 slow_query_log_file 慢查询日志存放的位置(这个目录需要MySQL的运行帐号的可写权限,一般设置为MySQL的数据存放目录) long_query_time 查询超过多少秒才记录 查看是否开启慢查询 show variables like "%slow%"; show variables like "%time%"; 方法一:全局变量设置 查询超过1秒就记录 mysql> set glob…