环境信息
------------------------------------------------------------
RHEL 6 -x86_64
yum(如未安装yum,请先安装yum,参考:安装及源配置)
------------------------------------------------------------
安装mysql
yum搜索mysql
yum search mysql
搜索结果如下
MySQL-python.x86_64 : An interface to MySQL apr-util-mysql.x86_64 : APR utility library MySQL DBD driver bacula-director-mysql.x86_64 : Bacula Director with MySQL database support bacula-storage-mysql.x86_64 : MySQL Bacula storage daemon files dovecot-mysql.x86_64 : MySQL back end for dovecot freeradius-mysql.x86_64 : MySQL support for freeradius libdbi-dbd-mysql.x86_64 : MySQL plugin for libdbi mod_auth_mysql.x86_64 : Basic authentication for the Apache web server using a MySQL database mysql.x86_64 : MySQL client programs and shared libraries mysql-bench.x86_64 : MySQL benchmark scripts and data mysql-connector-java.noarch : Official JDBC driver for MySQL mysql-connector-odbc.x86_64 : ODBC driver for MySQL mysql-devel.i686 : Files for development of MySQL applications mysql-devel.x86_64 : Files for development of MySQL applications mysql-embedded.i686 : MySQL as an embeddable library mysql-embedded.x86_64 : MySQL as an embeddable library mysql-embedded-devel.i686 : Development files for MySQL as an embeddable library mysql-embedded-devel.x86_64 : Development files for MySQL as an embeddable library mysql-libs.x86_64 : The shared libraries required for MySQL clients mysql-libs.i686 : The shared libraries required for MySQL clients mysql-server.x86_64 : The MySQL server and related files mysql-test.x86_64 : The test suite distributed with MySQL perl-DBD-MySQL.x86_64 : A MySQL interface for perl php-mysql.x86_64 : A module for PHP applications that use MySQL databases qt-mysql.i686 : MySQL driver for Qt‘s SQL classes qt-mysql.x86_64 : MySQL driver for Qt‘s SQL classes qt3-MySQL.i686 : MySQL drivers for Qt 3‘s SQL classes qt3-MySQL.x86_64 : MySQL drivers for Qt 3‘s SQL classes rsyslog-mysql.x86_64 : MySQL support for rsyslog
在这里我们安装mysql-server.x86_64,过程中有询问是否下载,输y即可,等待下载完成....
yum install mysql-server.x86_64
看到以下字样则安装成功
Installed: mysql-server.x86_64 0:5.1.73-3.el6_5 Dependency Installed: mysql.x86_64 0:5.1.73-3.el6_5 perl-DBD-MySQL.x86_64 0:4.013-3.el6 perl-DBI.x86_64 0:1.609-4.el6 Dependency Updated: mysql-libs.x86_64 0:5.1.73-3.el6_5 openssl.x86_64 0:1.0.1e-16.el6_5.14 Complete!
检查mysql状态,默认情况下是未启动的(mysqld is stopped)
/etc/rc.d/init.d/mysqld status
启动mysql测试
/etc/rc.d/init.d/mysqld start mysql
显示登录成功,可以顺手敲个"show databases;",这里不做演示,输入"exit",退出mysql
mysqld服务
查看mysqld服务,默认情况下是全部关闭的
chkconfig --list | grep mysql
显示如下:
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
打开mysqld服务
chkconfig mysqld on
再次查看
chkconfig --list | grep mysql
显示如下:
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
本文完
Redhat下Mysql安装配置,布布扣,bubuko.com
时间: 2024-10-12 20:33:02