mysql> use mysql;
mysql> update user set password=password('new_password') where user='root';
mysql> flush privileges;
創(chuàng)建數(shù)據(jù)庫
CREATE DATABASE DB_NAME DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE embodaily DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
創(chuàng)建用戶并設(shè)置權(quán)限
create user gopub IDENTIFIED by 'welovetime';
create user user IDENTIFIED by 'xxxxx';
rename user feng to newuser;
drop user newuser;
set password for zx_root =password('xxxxxx');
update mysql.user set password=password('xxxx') where user='otheruser'
show grants for zx_root;
grant select on dmc_db.* to zx_root;
grant ALL on dmc_db.* to zx_root;
grant all privileges on testdb to dba@’localhost’
flush privileges ;