[root@leaf]# yum list installed | grep mysql 如果你在安装CentOS的时候指定了安装MySQL数据库,就要有显示,这里我并没有安装MySQL。
安装MySQL数据库:
[root@leaf ~]# yum -y install mysql-server mysql mysql-devel 注意在你的系统上查看安装成功后的提示信息。
查看安装的MySQL信息:
[root@leaf ~]# yum list installed | grep mysql
mysql.x86_64 5.1.73-5.el6_6 @base
mysql-devel.x86_64 5.1.73-5.el6_6 @base
mysql-libs.x86_64 5.1.73-5.el6_6 @base
mysql-server.x86_64 5.1.73-5.el6_6 @base
开启MySQL服务:
[root@leaf ~]# service mysqld start
Starting mysqld: [ OK ]
登陆到MySQL数据库中:
[root@leaf ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>