前提:關(guān)閉防火墻
登錄MySQL:
? mysql -u root -p db;
執(zhí)行以下命令開(kāi)啟遠(yuǎn)程訪(fǎng)問(wèn)限制:
? grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
? flush privileges;
? exit;
上面的‘%’是開(kāi)啟的所有IP 的,‘%’代替IP;
‘password’為遠(yuǎn)程數(shù)據(jù)庫(kù)設(shè)置的訪(fǎng)問(wèn)密碼。