關於MySQL建立新使用者並授權

來源:互聯網
上載者:User

標籤:登入   enter   student   password   關於   修改   文法   roo   str   

  • 建立使用者的文法:

         Create user  `username`@host  [Identified by [password]  `password`];

  1. Username:使用者名稱
  2. Host:主機名稱,本地主機可以用localhost或者ip地址,但是其他電腦必須用ip地址登入遠程主機用萬用字元 “%”
  3. Password:使用者密碼

例:

         create user  `teacher`@`localhost` identified  by  ‘12345’,   或者

         create user  `teacher`@`localhost  (無密碼)

 

  • 執行grant(賦許可權的同時)  建立使用者

文法:

Grant  priv_type  on 資料庫或者資料表 to [email protected](或者IP地址)  identified  by  ‘123’;

 

 

  • 使用mysql Admin修改root賬戶密碼
  • 文法:

         Mysqladmin –u root –p password  “123”;

         Enter password:原密碼(root);

 

  • 使用set密令修改普通使用者密碼(mysql的命令)

文法:

         Set password=password(“000”);                           //修改目前使用者密碼

         Set password for [email protected]=password(“123”);   //修改指定賬戶密碼

 

  • 刪除普通使用者

    Drop  user  `studentr` @localhost;

關於MySQL建立新使用者並授權

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.