Mysql 常用命令

1. 修改密码

1.1 set password

  登录mysql

  set password for 用户名@localhost = password('新密码');

1.2 mysqladmin 

  mysqladmin -u用户名 -p旧密码 password 新密码 

1.3  user表  

  mysql> use mysql; 

  mysql> update user set password=password('新密码') where user='root' and host='localhost'; 

  mysql> flush privileges; 

2. 设置远程连接MySQL 

  GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456';

  GRANT GRANT OPTION ON *.* TO 'root'@'%';

  FLUSH PRIVILEGES;

3. 强制卸载rpm包

  rpm -e --nodeps  xxx;

你可能感兴趣的:(Mysql 常用命令)