mysql免密碼登錄 如何不用密碼登錄mysql?
如何不用密碼登錄mysql?1. 編輯MySQL(與PHP的最佳組合)的配置文件:Windows環(huán)境下:MySQL(與PHP的最佳組合)uinstalldir%/我的.ini//MySQL的安裝目錄中
如何不用密碼登錄mysql?
1. 編輯MySQL(與PHP的最佳組合)的配置文件:Windows環(huán)境下:MySQL(與PHP的最佳組合)uinstalldir%/我的.ini//MySQL的安裝目錄中一般都有(與PHP的最佳結(jié)合)我的.ini這是MySQL的配置文件(與PHP的最佳組合)。
在Linux環(huán)境/etc/我的.cnf
在[MySQL(與PHP的最佳組合)D]的配置部分添加以下行:
跳過grant tables
保存并退出編輯。
2. 然后重啟MySQL(與PHP的最佳組合)服務(wù)
在Windows環(huán)境下:
net stop MySQL(與PHP的最佳組合)
net start MySQL(與PHP的最佳組合)
在Linux環(huán)境下:
/etc/init.d/MySQL(與PHP的最佳組合)d restart
3。設(shè)置新的根密碼
然后在命令行下執(zhí)行:
MySQL(與PHP的最佳組合)-Uroot-P MySQL(與PHP的最佳組合)
直接進(jìn)入數(shù)據(jù)庫,無需密碼。
現(xiàn)在我們執(zhí)行以下語句將root密碼更新為7758521:
update user set password=password(“7758521”)where user=“root”
退出MySQL(與PHP的最佳組合)。
mysql用戶無法用密碼登錄解決,不用密碼可以直接登錄?
1. 刪除空用戶
刪除用戶“@”localhost“
2。出于安全原因,建議只保留一個本地root用戶
drop user root@“::1”
drop user“root”@“l(fā)ocalhost”
mysql用戶無法用密碼登錄解決,不用密碼可以直接登錄?
1。刪除空用戶“”@“l(fā)ocalhost “”2。出于安全原因,建議只保留一個本地root用戶root@::1“drop user”root“@”localhost“drop user”root“@”%”