1 準(zhǔn)備
- rhel-server-6.5-i386-dvd.iso
2 創(chuàng)建本地安裝源
將系統(tǒng)安裝的鏡像文件rhel-server-6.5-i386-dvd.iso
拷貝至/root
目錄下肺魁。
2.1 掛載鏡像
# mount -t iso9660 -o loop /root/rhel-server-6.5-i386-dvd.iso /mnt
2.2 刪除舊安裝源
# rm -rf /etc/yum.repos.d/*
2.3 創(chuàng)建新安裝源dvd.repo
打開/etc/yum.repos.d/dvd.repo
澜汤,添加以下內(nèi)容
# vim /etc/yum.repos.d/dvd.repo
[dvd]
name=install dvd
baseurl=file:///mnt
enabled=1
gpgcheck=0
2.4 刷新repos,生成緩存
# yum makecache
3 安裝Mysql環(huán)境
3.1 安裝Mysql包
# yum -y install mysql-server mysql mysql-devel
3.2 查看安裝包
# rpm -qa | grep mysql
mysql-libs-5.1.71-1.el6.i686
mysql-server-5.1.71-1.el6.i686
mysql-5.1.71-1.el6.i686
mysql-devel-5.1.71-1.el6.i686
3.3 啟動Mysql服務(wù)
# service mysqld start
Starting mysqld: [ OK ]
3.4 配置Mysql
- 修改root密碼
mysql安裝完后淮悼,默認(rèn)的root密碼為空喻杈,需要修改密碼晦款。
mysqladmin -u root password "123456";
- 確認(rèn)密碼已修改
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.71 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>
- 允許本地和遠(yuǎn)程連接
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
3.5 設(shè)置開機(jī)啟動項(xiàng)
在/etc/rc.d/rc.local
文件末尾添加一行service mysqld start