虚拟机shell连接有点问题,于是干脆用yum安装,很简单如下:yum install mysql yum install mysql-server yum install mysql-devel chgrp -R mysql /var/lib/mysql chmod -R 770/var/lib/mysql service mysqld start mysql SET PASSWORD FOR 'root'@'localhost'= PASSWORD('secret_password'); 更新