為了安全,MySQL開啟了遠程訪問,需要經常更換MySQL連接密碼。
不知道自己有沒有開啟遠程訪問,就先看看
use mysql select host, user from user;
如果是 localhost root,則只能本地訪問。如果是 % root則可以遠程訪問。
修改密碼,是否為localhost用戶決定了這里的修改密碼的用戶,根據自己的用戶更改
alter user 'root'@'localhost' identified by '密碼'; alter user 'root'@'%' identified by '密碼';
如果報錯:Your password does not satisfy the current policy requirements。。。說明密碼不夠復雜
