標籤:linux yum mysql 安裝 服務
環境資訊
------------------------------------------------------------
RHEL 6 -x86_64
yum(如未安裝yum,請先安裝yum,參考:安裝及源配置)
------------------------------------------------------------
安裝mysql
yum搜尋mysql
yum search mysql
搜尋結果如下
MySQL-python.x86_64 : An interface to MySQLapr-util-mysql.x86_64 : APR utility library MySQL DBD driverbacula-director-mysql.x86_64 : Bacula Director with MySQL database supportbacula-storage-mysql.x86_64 : MySQL Bacula storage daemon filesdovecot-mysql.x86_64 : MySQL back end for dovecotfreeradius-mysql.x86_64 : MySQL support for freeradiuslibdbi-dbd-mysql.x86_64 : MySQL plugin for libdbimod_auth_mysql.x86_64 : Basic authentication for the Apache web server using a MySQL databasemysql.x86_64 : MySQL client programs and shared librariesmysql-bench.x86_64 : MySQL benchmark scripts and datamysql-connector-java.noarch : Official JDBC driver for MySQLmysql-connector-odbc.x86_64 : ODBC driver for MySQLmysql-devel.i686 : Files for development of MySQL applicationsmysql-devel.x86_64 : Files for development of MySQL applicationsmysql-embedded.i686 : MySQL as an embeddable librarymysql-embedded.x86_64 : MySQL as an embeddable librarymysql-embedded-devel.i686 : Development files for MySQL as an embeddable librarymysql-embedded-devel.x86_64 : Development files for MySQL as an embeddable librarymysql-libs.x86_64 : The shared libraries required for MySQL clientsmysql-libs.i686 : The shared libraries required for MySQL clientsmysql-server.x86_64 : The MySQL server and related filesmysql-test.x86_64 : The test suite distributed with MySQLperl-DBD-MySQL.x86_64 : A MySQL interface for perlphp-mysql.x86_64 : A module for PHP applications that use MySQL databasesqt-mysql.i686 : MySQL driver for Qt‘s SQL classesqt-mysql.x86_64 : MySQL driver for Qt‘s SQL classesqt3-MySQL.i686 : MySQL drivers for Qt 3‘s SQL classesqt3-MySQL.x86_64 : MySQL drivers for Qt 3‘s SQL classesrsyslog-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 startmysql
顯示登入成功,可以順手敲個"show databases;",這裡不做示範,輸入"exit",退出mysql
mysqld服務
查看mysqld服務,預設情況下是全部關閉的
chkconfig --list | grep mysql
顯示如下:
mysqld 0:off1:off2:off3:off4:off5:off6:off
開啟mysqld服務
chkconfig mysqld on
再次查看
chkconfig --list | grep mysql
顯示如下:
mysqld 0:off1:off2:on3:on4:on5:on6:off
本文完
本文出自 “以銅為鏡” 部落格,請務必保留此出處http://tangoo.blog.51cto.com/9130178/1532990