差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

Both sides previous revision 前次修改
下次修改
前次修改
mysql [2017/12/04 22:38]
jz
mysql [2019/02/19 02:06] (目前版本)
jz [Change credential]
行 31: 行 31:
 <code mysql> <code mysql>
 SET PASSWORD FOR '​user'​@'​localhost'​ = PASSWORD('​password'​);​ SET PASSWORD FOR '​user'​@'​localhost'​ = PASSWORD('​password'​);​
 +-- or
 +update mysql.user set password=PASSWORD(‘新password’) where User=’root’;​­
 +-- and then
 +flush privileges;​­
 </​code>​ </​code>​
  
行 43: 行 47:
 SELECT host, user, password FROM mysql.user; SELECT host, user, password FROM mysql.user;
 SHOW GRANTS FOR username@localhost;​ SHOW GRANTS FOR username@localhost;​
 +</​code>​
 +
 +===== Remote grants =====
 +<code sql>
 +revoke all privileges on newdatabase.* from '​newuser'​@'​localhost';​
 +flush privileges;
 +</​code>​
 +
 +===== List databases =====
 +<code sql>
 +SHOW DATABASES
 </​code>​ </​code>​