mysql帳號許可權控制,mysql許可權控制

來源:互聯網
上載者:User

mysql帳號許可權控制,mysql許可權控制

1.如果我們不是用root帳號操作資料庫,我們可能經常會遇到一些許可權問題,下面給出最簡單的解決方案:

GRANT ALL PRIVILEGES ON *.* TO '$username'@'$address' IDENTIFIED BY '$password' WITH GRANT OPTION;flush privileges;

上面語句賦予所有資料庫操作許可權給$username使用者,其中自行替換$username, $address, $password參數;

還有一個誤區,localhost 及 127.0.0.1 需要分別授權,兩者並非等價的。


著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

相關文章

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.