mysql进入
创建用户 kamy,密码kamy321
CREATE USER kamy IDENTIFIED BY ‘kamy321’;
CREATE USER root IDENTIFIED BY ‘Kamy321’;
update mysql.user set authentication_string=password(‘kamy321’) where user=’kamy’ and host=’%’;
update mysql.user set authentication_string=password(‘Kamy321’) where user=’root’ and host=’%’;
update mysql.user set authentication_string=password(‘kamy321’) where user=’kamy’ and host=’localhost’;
update mysql.user set authentication_string=password(‘Kamy321’) where user=’kamy’ and host=’localhost’;
查询所有的权限账户
select host,user,password from mysql.user;
update user set host=’%’ where user=’root’ and host=’localhost’;
update user set host=’localhost’ where user=’root’ and host=’%’;
显示数据库
show databases;
创建数据库
CREATE DATABASE 数据库名;
GRANT ALL PRIVILEGES ON . TO ‘kamy’@’%’ IDENTIFIED BY ‘kamy321’ WITH GRANT OPTION;
grant all privileges on . to ‘root’@’%’ identified by ‘Kamy321’ with grant option;
grant all privileges on . to ‘root’@’localhost’ identified by ‘Kamy321’ with grant option;
grant all privileges on . to ‘kamy’@’%’ identified by ‘kamy321’ with grant option;
grant all privileges on . to ‘kamy’@’localhost’ identified by ‘kamy321’ with grant option;
flush privileges;
