mysql資料庫管理

來源:互聯網
上載者:User

標籤:pre   sel   roo   creat   The   ado   service   oca   password   

建立使用者及密碼mysql> create user ‘zhao‘@‘loacl‘ identified by ‘123123‘;mysql> use mysql;

建立密文密碼mysql> select password(‘123123‘);  #查看明文對應的密文

mysql> create user ‘test01‘@‘localhost‘ identified by   #建立密文密碼 ‘E56A114692FE0DE073F9A1DD68A00EEB9703F3F1‘;刪除使用者mysql> drop user ‘test01‘@‘localhost‘;

修改已存在使用者的密碼set password =pssword(‘123123‘);修改其他使用者密碼set password for ‘user02‘@‘localhost‘ = password(‘123abc‘);重新命名使用者mysql> rename user ‘zz‘@‘host‘ to ‘user01‘@‘host‘;

使用者授權mysql> grant select,update on *.* to ‘user01‘@‘localhost‘ identified by ‘123123‘; #給使用者user01添加對所有庫和表擁有select,update許可權

取消使用者授權mysql> revoke update on *.* from ‘user01‘@‘localhost‘; #對user01使用者取消update許可權

使用者忘記密碼1.修改設定檔systamctl stop mysqld.service       #關掉資料庫vim /etc/my.cnf skip-grant-tables               #在mysqld這段最下面插入(跳過驗證)systamctl start mysqld.service      #開啟資料庫2.直接進入資料庫修改密碼mysql         #直接進入資料庫mysql> update mysql.user set authentication_string =passwordd(‘123123‘);mysql> quit3.測試登入資料庫[[email protected] data]# mysql -uroot -p123123......   省略部分內容mysql>   #成功進入mysql資料庫

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.