Unix\Linux下如何修改MySQL數據庫密碼

      Unix&Linux: 
      1.用root或者運行mysqld的用戶登陸系統; 
      2.利用kill命令結束掉mysqld的進程; 
      3.使用--skip-grant-tables參數啓動MySQL Server 
       shell>mysqld_safe --skip-grant-tables & 
      4.爲root@localhost設置新密碼 
       shell>mysqladmin -u root flush-privileges password "newpassword"

     5.重啓MySQL Server mysql

      mysql修改密碼
  mysql修改,可在mysql命令行執行以下:
  mysql -u root mysql 
  mysql> Update user SET password=PASSWORD("new password") Where user='name'; 
  mysql> FLUSH PRIVILEGES; 
  mysql> QUIT
相關文章
相關標籤/搜索