1.启动MySQL服务:# service mysqld start
2.为MySQL设置root用户密码:# mysql -u root
mysql>set password for root@localhost=password('此处是想要设置的密码');
3.退出mysql:exit
4.用密码登陆mysql: # mysql -u root -p
5.开放远程登陆权限:GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
FLUSH PRIVILEGES;