久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      Mysql用戶(hù)管理相關(guān)知識(shí)介紹

      當(dāng)前使用的user及host:

      mysql> select USER(); +----------------+ | USER()         | +----------------+ | root@localhost | +----------------+ 1 row in set (0.00 sec)

      添加用戶(hù)

      mysql5以前版本直接使用 INSERT 向 mysql 表中插入mysql用戶(hù)了,mysql5之后不可以這樣操作

      mysql> insert into mysql.user(Host,User,Password) values('localhost','test_user',password('123123')); ERROR 1062 (23000): Duplicate entry 'localhost-test_user' for key 'PRIMARY'

      增加用戶(hù) {授予用戶(hù)指定數(shù)據(jù)表權(quán)限 [使用 GRANT 命令 對(duì)用戶(hù)進(jìn)行相應(yīng)授權(quán)]}

      mysql> GRANT all privileges ON table1.* TO  'test_user'@'localhost' IDENTIFIED BY '123123' WITH GRANT OPTION; Query OK, 0 rows affected (0.02 sec)

      IDENTIFIED BY 指定用戶(hù)的登錄密碼

      ALL PRIVILEGES 是表示所有權(quán)限,也可以使用 select、update 等權(quán)限

      *. 中前面的*號(hào)用來(lái)指定數(shù)據(jù)庫(kù)名,后面的*號(hào)用來(lái)指定表名

      TO 表示將權(quán)限賦予某個(gè)用戶(hù)

      ON 用來(lái)指定權(quán)限針對(duì)哪些庫(kù)和表

      'test_user'@'localhost' 表示test_user用戶(hù),@后面接限制的主機(jī),可以是IP、IP段、域名以及%,%表示任何地方

      WITH GRANT OPTION 這個(gè)選項(xiàng)表示該用戶(hù)可以將自己擁有的權(quán)限授權(quán)給別人

      需要刷新系統(tǒng)權(quán)限表[flush privilege] 該用戶(hù)才能生效登錄

      mysql> flush privileges;

      刪除用戶(hù)

      mysql> drop user 'test_user'@'localhost';

      查看當(dāng)前用戶(hù)的權(quán)限

      mysql> SHOW GRANTS; +----------------------------------------------------------------------------------------------------------------------------------------+ | Grants for root@localhost                                                                                                              | +----------------------------------------------------------------------------------------------------------------------------------------+ | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*E56A114692FE0DE073F9A1DD68A00EEB9703F3F1' WITH GRANT OPTION | | GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION                                                                           | +----------------------------------------------------------------------------------------------------------------------------------------+

      查看某個(gè)用戶(hù)的權(quán)限

      mysql> show grants for 'test_user'@'localhost' +------------------------------------------------------------------------------------------------------------+ | Grants for test_user@localhost                                                                                   | +------------------------------------------------------------------------------------------------------------+ | GRANT USAGE ON *.* TO 'test_user'@'localhost' IDENTIFIED BY PASSWORD '*E56A114692FE0DE073F9A1DD68A00EEB9703F3F1' | | GRANT ALL PRIVILEGES ON table1.* TO 'test_user'@'localhost' WITH GRANT OPTION                                 | +------------------------------------------------------------------------------------------------------------+

      對(duì)賬戶(hù)重命名

      mysql> rename user 'test_user'@'localhost' to 'bb'@'localhost';

      修改密碼

      1.用set password命令

      mysql> SET PASSWORD FOR 'test_user'@'localhost' = PASSWORD('123456');

      2.用 mysqladmin [進(jìn)入bin目錄](méi)

      備注:{格式: mysqladmin -u用戶(hù)名 -p舊密碼 password 新密碼]

      /usr/bin$ mysqladmin -utest_user -p123456 password 123123 mysqladmin: Can't turn off logging; error: 'Access denied; you need (at least one of) the SUPER privilege(s) for this operation'

      3.用 update 直接編輯 user 表

      mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> update user set PASSWORD = PASSWORD('123123') where user = 'test_user'; Query OK, 1 row affected (0.04 sec) Rows matched: 1  Changed: 1  Warnings: 0

      推薦教程:《MySQL教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)