CentOS 6.5 安装MySQL数据库

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

 

posted on 2016-09-07 17:02  随风浪子的博客  阅读(258)  评论(0编辑  收藏  举报

导航