“MySQL”的版本间的差异

来自Gea-Suan Lin's Wiki
跳到导航 跳到搜索
首段
常用指令
 
(未显示同一用户的8个中间版本)
第3行: 第3行:
 
== 常用指令 ==
 
== 常用指令 ==
 
 開帳號順便開權限:
 
 開帳號順便開權限:
<syntaxhighlight syntax="sql">
+
<syntaxhighlight lang="sql">
 
GRANT ALL ON trac.* TO `trac`@`localhost` IDENTIFIED BY 'password_here';
 
GRANT ALL ON trac.* TO `trac`@`localhost` IDENTIFIED BY 'password_here';
 +
GRANT ALL ON trac.* TO `trac`@`%` IDENTIFIED BY 'password_here';
 +
</syntaxhighlight>
 +
 +
刪除(同時也會移除權限):
 +
<syntaxhighlight lang="sql">
 +
DROP USER 'trac'@'localhost';
 +
</syntaxhighlight>
 +
 +
只移除權限(單一資料庫或是全部):
 +
<syntaxhighlight lang="sql">
 +
REVOKE ALL, GRANT OPTION ON trac.* FROM 'trac'@'localhost';
 +
REVOKE ALL, GRANT OPTION FROM 'trac'@'localhost';
 +
</syntaxhighlight>
 +
 +
改密碼:
 +
<syntaxhighlight lang="sql">
 +
SET PASSWORD = 'newPassword';
 
</syntaxhighlight>
 
</syntaxhighlight>
  

2018年12月26日 (三) 08:19的最新版本

MySQL是一套資料庫軟體。

常用指令

開帳號順便開權限:

GRANT ALL ON trac.* TO `trac`@`localhost` IDENTIFIED BY 'password_here';
GRANT ALL ON trac.* TO `trac`@`%` IDENTIFIED BY 'password_here';

刪除(同時也會移除權限):

DROP USER 'trac'@'localhost';

只移除權限(單一資料庫或是全部):

REVOKE ALL, GRANT OPTION ON trac.* FROM 'trac'@'localhost';
REVOKE ALL, GRANT OPTION FROM 'trac'@'localhost';

改密碼:

SET PASSWORD = 'newPassword';

相關連結

外部連結