select user,host,password from mysql.user;
set password for root@localhost=password('your new password');
或者mysql
set password for root@127.0.0.1=password('your new password');
exit
mysql -u root -p
select user,host from mysql.user;
delect from mysql.user where user = '';
flush privileges;
insert into mysql.user(Host,User,Password) values("localhost", "yourusername", password("yourpaddword"));
flush privileges;
CREATE DATABASE `db_test` DEFAULT CHARRACTER SET utf8 COLLATE utf8_general_ci;
grant all privileges on db_test.* to yourusername@localhost identified by 'yourpassword';
grant all privileges on db_test.* to 'yourusername'@'%' identified by 'yourpassword';
grant select,insert,update on db_test.* to yourusername@'192.168.199.111' identified by 'yourpassword';
人若無名,專心練劍! 喜歡的朋友能夠留下你的贊!sql