[root@bogon~]#yum-yinstallMysqL-server
2.设置开机启动
[html]view plaincopy
代码片" height="12" src="http://img.jb51.cc/vcimg/000/000/004/064_75a_b83.png" width="12" style="padding:0px;margin:0px;border:none;">
代码片" height="12" src="http://img.jb51.cc/vcimg/000/000/004/065_737_1b7.svg" width="12" style="padding:0px;margin:0px;border:none;">
[root@bogon~]#chkconfigMysqLdon
3.启动MysqL服务
[html]view plaincopy
代码片" height="12" src="http://img.jb51.cc/vcimg/000/000/004/064_75a_b83.png" width="12" style="padding:0px;margin:0px;border:none;">
代码片" height="12" src="http://img.jb51.cc/vcimg/000/000/004/065_737_1b7.svg" width="12" style="padding:0px;margin:0px;border:none;">
[root@bogon~]#serviceMysqLdstart
[html]view plaincopy
代码片" height="12" src="http://img.jb51.cc/vcimg/000/000/004/064_75a_b83.png" width="12" style="padding:0px;margin:0px;border:none;">
代码片" height="12" src="http://img.jb51.cc/vcimg/000/000/004/065_737_1b7.svg" width="12" style="padding:0px;margin:0px;border:none;">
[root@bogon~]#MysqL-uroot
+------+-----------+----------+
|user|host|password|
+------+-----------+----------+
|root|localhost||
|root|bogon||
|root|127.0.0.1||
||localhost||
||bogon||
+------+-----------+----------+
5rowsinset(0.01sec)
查询用户的密码,都为空,用下面的命令设置root的密码为root
[html]view plaincopy
代码片" height="12" src="http://img.jb51.cc/vcimg/000/000/004/064_75a_b83.png" width="12" style="padding:0px;margin:0px;border:none;">
代码片" height="12" src="http://img.jb51.cc/vcimg/000/000/004/065_737_1b7.svg" width="12" style="padding:0px;margin:0px;border:none;">
5.用新密码登陆
[html]view plaincopy
代码片" height="12" src="http://img.jb51.cc/vcimg/000/000/004/064_75a_b83.png" width="12" style="padding:0px;margin:0px;border:none;">
代码片" height="12" src="http://img.jb51.cc/vcimg/000/000/004/065_737_1b7.svg" width="12" style="padding:0px;margin:0px;border:none;">
[root@bogon~]#MysqL-uroot-p
Enterpassword: