1.啓動MySQL服務:# service mysqld startmysql
2.爲MySQL設置root用戶密碼:# mysql -u rootsql
mysql>set password for root@localhost=password('此處是想要設置的密碼');it
3.退出mysql:exitservice
4.用密碼登錄mysql: # mysql -u root -p權限
5.開放遠程登錄權限:GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
FLUSH PRIVILEGES;密碼