每次要設定 mysql 的資料庫給外面的廠商,都一直忘記指令……


來記錄一下指令~

  • 新增使用者
    INSERT INTO user(host,user,password) VALUES(‘%’,’camel’,password(‘2243’));
  • 授予特定資料庫全部權限(camel/2243)
    GRANT ALL ON dbname.* TO ‘camel’@localhost IDENTIFIED BY ‘2243’;
  • 移除使用者(camel)特定資料庫權限
    REVOKE ALL PRIVILEGES ON dbname.* FROM ‘camel’@’localhost’;
  • 移除使用者(camel)
    DROP USER ‘camel’@’localhost’;

 

參考資料:

http://blog.toright.com/posts/1214/mysql-%E6%96%B0%E5%A2%9E%E4%BD%BF%E7%94%A8%E8%80%85%E8%88%87%E6%AC%8A%E9%99%90%E8%A8%AD%E5%AE%9A-%E7%AD%86%E8%A8%98.html

 

Leave a Reply