为mysql添加用户和修改密码

为mysql添加用户和修改密码

 

>GRANTE ALL PRIVILEGES ON  *.*   TO 'Tube'@'192.168.0.254' identified by '123456' with grante option   添加Tube用户。

>flush privileges  刷新授权表

>drop user 'Tube'@'192.168.0.254'  删除Tube用户

修改Tube用户密码

>grant usage on *.* to 'Tube'@'192.168.0.254' identified by '654321'

>flush privileges  刷新授权表

 

 

root密码忘记解决之道。

#service mysqld stop

#mysql -u root | use mysql;

>update user set password=password('new-password') where user='root';

#service mysqld start

你可能感兴趣的:(mysql,添加用户,修改密码)