mysql root密碼修改

2021-06-28 11:16:09 字數 414 閱讀 1111

1、停掉你的mysql伺服器

2、開啟cmd

3、進到你mysql目錄下的bin目錄裡

4、看看你伺服器的檔案是什麼,一般為mysqld.exe/mysqld-nt.exe

5、在cmd中輸入mysqld(或mysqld-nt) --skip-grant-tables(按enter)

6、新開啟乙個cmd,輸入mysql -uroot -e "use mysql;update user set password=passw

ord('new_password') where user='root';flush privileges;"

注:new_password 為你的新密碼,自己改

7、使用mysql -uroot -pnew_password(按enter進入即可)

修改mysql root密碼

一 擁有原來的myql的root的密碼 方法一 在mysql系統外,使用mysqladmin mysqladmin u root p password test123 enter password 輸入原來的密碼 方法二 通過登入mysql系統,mysql uroot p enter passwor...

修改mysql root密碼

一 擁有原來的myql的root的密碼 方法一 在mysql系統外,使用mysqladmin mysqladmin u root p password test123 enter password 輸入原來的密碼 方法二 通過登入mysql系統,mysql uroot p enter passwor...

修改mysql root密碼

1 修改mysql的配置檔案 預設為 etc my.cnf 在 mysqld 下新增一行skip grant tables 2 儲存配置檔案後,重啟mysql服務 service mysqld restart 3 mysql u root p登入mysql,然後不輸入密碼直接回車,然後按照上面的流程...