码迷,mamicode.com
首页 > 数据库 > 详细

CentOS 6.5 安装MySQL数据库

时间:2016-09-07 17:43:30      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:

CentOS 6.5 安装MySQL数据库

[root@seeker~]#  yum -y install mysql-server  //安装命令
[root@seeker~]#  service mysqld start           //连接之前先启动服务
[root@seeker~]#  chkconfig mysqld on           //开机启动设置,也可以手动开启
[root@seeker~]#  mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
......
//安装成功之后密码为空,需要自己重新设置。
mysql> set password for root@localhost=password(root);
mysql> exit
//用新密码登陆
[root@seeker~]#  mysql -u root -p

//测试
show databases;         //查看系统已存在的数据库
use test;                    //选择需要使用的数据库
exit                     //退出数据库的连接

其他命令:
rpm -qa|grep mysql    //显示已安装的mysql版本

也可以通过下载rpm软件包来安装mysql

 

CentOS 6.5 安装MySQL数据库

标签:

原文地址:http://www.cnblogs.com/liun1994/p/5850121.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!