mysql 5.6 for linux (rpm包安裝)
mysql 5.6 rpm包 for linux 安裝
安裝系統,並關閉selinux與iptables
1 關閉selinux 修改selinux配置檔案(重啟伺服器生效)
[root@mysql1 ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
2 管理iptables(重啟伺服器生效)
停止iptables
[root@mysql1 ~]# /etc/init.d/iptables stop
關閉iptables開機啟動
[root@mysql1 ~]# chkconfig --list iptables
iptables 0:關閉 1:關閉 2:關閉 3:關閉 4:關閉 5:關閉 6:關閉
3 查詢系統是否存在mysql殘存包如果存在刪除處理,以保證mysql安裝無問題。
查詢
[root@mysql1 install]# rpm -qa|grep mysql
mysql-libs-5.1.71-1.el6.x86_64
存在並刪除
[root@mysql1 install]# rpm -e mysql-libs-5.1.71-1.el6.x86_64 --nodeps
4 安裝mysql相關檔案
安裝server
[root@mysql1 install]# rpm -ivh MySQL-server-5.6.29-1.rhel5.x86_64.rpm
warning: MySQL-server-5.6.29-1.rhel5.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
安裝devel
[root@mysql1 install]# rpm -ivh MySQL-devel-5.6.29-1.rhel5.x86_64.rpm
warning: MySQL-devel-5.6.29-1.rhel5.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-devel ########################################### [100%]
安裝 client
[root@mysql1 install]# rpm -ivh MySQL-client-5.6.29-1.rhel5.x86_64.rpm
warning: MySQL-client-5.6.29-1.rhel5.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]
5 有中文存放mysql資料庫 修改引數檔案(手動建立即可)
[root@mysql1 install]# vi /etc/my.cnf
[client]
#客戶端字符集
default-character-set=utf8
[mysqld]
#字符集
character-set-server=utf8
#不區分大小寫
lower_case_table_names=1
[mysql]
#字符集
default-character-set=utf8
6 啟動mysql服務
[root@mysql1 install]# /etc/init.d/mysql start
7 修改登入密碼
初始密碼位置為安裝使用者根目錄下
[root@mysql1 ~]# cat /root/.mysql_secret
# The random password set for the root user at Thu Jul 28 14:31:34 2016 (local time): 903yX2XlB1edVpua
8 登入並修改密碼
[root@mysql1 ~]# mysql -uroot -p903yX2XlB1edVpua
mysql> set password=password('oracle');
Query OK, 0 rows affected (0.00 sec)
mysql> use mysql;
mysql> UPDATE user SET Password = password('oracle') WHERE User = 'root' ;
mysql> flush privileges;
mysql> exit
9 修改預設資料檔案路徑
建立目錄
[root@mysql1 ~]# cd /home/
[root@mysql1 home]# mkdir mysql
停止mysql服務
[root@mysql1 home]# /etc/init.d/mysql stop
Shutting down MySQL..[確定]
10 CP 資料檔案至新路徑
[root@mysql1 home]# cp -r /var/lib/mysql/ /home/mysql/
修改my.cnf檔案與/etc/init.d/mysql檔案
my.cnf檔案新增socket路徑
[root@mysql1 home]# vi /etc/my.cnf
[client]
#客戶端字符集
default-character-set=utf8
socket = /home/mysql/mysql.sock
[mysqld]
socket = /home/mysql/mysql.sock
#字符集
character-set-server=utf8
#不區分大小寫
lower_case_table_names=1
[mysql]
#字符集
default-character-set=utf8
auto-rehash
修改mysql檔案中datadir路徑資訊
[root@mysql1 home]# vi /etc/init.d/mysql
# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files.
basedir=
datadir=/home/mysql/
修改新建mysql儲存目錄許可權(試過755和775都報錯 只有賦值777時啟動無問題,不知道什麼原因)
[root@mysql1 home]# chmod -R 777 mysql/
[root@mysql1 home]# /etc/init.d/mysql start
Starting MySQL..[確定]
全文結束
安裝系統,並關閉selinux與iptables
1 關閉selinux 修改selinux配置檔案(重啟伺服器生效)
[root@mysql1 ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
2 管理iptables(重啟伺服器生效)
停止iptables
[root@mysql1 ~]# /etc/init.d/iptables stop
關閉iptables開機啟動
[root@mysql1 ~]# chkconfig --list iptables
iptables 0:關閉 1:關閉 2:關閉 3:關閉 4:關閉 5:關閉 6:關閉
3 查詢系統是否存在mysql殘存包如果存在刪除處理,以保證mysql安裝無問題。
查詢
[root@mysql1 install]# rpm -qa|grep mysql
mysql-libs-5.1.71-1.el6.x86_64
存在並刪除
[root@mysql1 install]# rpm -e mysql-libs-5.1.71-1.el6.x86_64 --nodeps
4 安裝mysql相關檔案
安裝server
[root@mysql1 install]# rpm -ivh MySQL-server-5.6.29-1.rhel5.x86_64.rpm
warning: MySQL-server-5.6.29-1.rhel5.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
安裝devel
[root@mysql1 install]# rpm -ivh MySQL-devel-5.6.29-1.rhel5.x86_64.rpm
warning: MySQL-devel-5.6.29-1.rhel5.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-devel ########################################### [100%]
安裝 client
[root@mysql1 install]# rpm -ivh MySQL-client-5.6.29-1.rhel5.x86_64.rpm
warning: MySQL-client-5.6.29-1.rhel5.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]
5 有中文存放mysql資料庫 修改引數檔案(手動建立即可)
[root@mysql1 install]# vi /etc/my.cnf
[client]
#客戶端字符集
default-character-set=utf8
[mysqld]
#字符集
character-set-server=utf8
#不區分大小寫
lower_case_table_names=1
[mysql]
#字符集
default-character-set=utf8
6 啟動mysql服務
[root@mysql1 install]# /etc/init.d/mysql start
7 修改登入密碼
初始密碼位置為安裝使用者根目錄下
[root@mysql1 ~]# cat /root/.mysql_secret
# The random password set for the root user at Thu Jul 28 14:31:34 2016 (local time): 903yX2XlB1edVpua
8 登入並修改密碼
[root@mysql1 ~]# mysql -uroot -p903yX2XlB1edVpua
mysql> set password=password('oracle');
Query OK, 0 rows affected (0.00 sec)
mysql> use mysql;
mysql> UPDATE user SET Password = password('oracle') WHERE User = 'root' ;
mysql> flush privileges;
mysql> exit
9 修改預設資料檔案路徑
建立目錄
[root@mysql1 ~]# cd /home/
[root@mysql1 home]# mkdir mysql
停止mysql服務
[root@mysql1 home]# /etc/init.d/mysql stop
Shutting down MySQL..[確定]
10 CP 資料檔案至新路徑
[root@mysql1 home]# cp -r /var/lib/mysql/ /home/mysql/
修改my.cnf檔案與/etc/init.d/mysql檔案
my.cnf檔案新增socket路徑
[root@mysql1 home]# vi /etc/my.cnf
[client]
#客戶端字符集
default-character-set=utf8
socket = /home/mysql/mysql.sock
[mysqld]
socket = /home/mysql/mysql.sock
#字符集
character-set-server=utf8
#不區分大小寫
lower_case_table_names=1
[mysql]
#字符集
default-character-set=utf8
auto-rehash
修改mysql檔案中datadir路徑資訊
[root@mysql1 home]# vi /etc/init.d/mysql
# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files.
basedir=
datadir=/home/mysql/
修改新建mysql儲存目錄許可權(試過755和775都報錯 只有賦值777時啟動無問題,不知道什麼原因)
[root@mysql1 home]# chmod -R 777 mysql/
[root@mysql1 home]# /etc/init.d/mysql start
Starting MySQL..[確定]
全文結束
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22390488/viewspace-2122857/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 基於Linux的MySQL5.7RPM包安裝LinuxMySql
- Linux安裝Mysql5.6LinuxMySql
- CentOS下使用rpm包安裝MySQLCentOSMySql
- Mysql for Linux安裝配置之—— rpm(bundle)安裝MySqlLinux
- mysql8.0.30的RPM包安裝方法MySql
- CentOS 下 MySQL 5.6 基於 RPM 的下載、安裝、配置CentOSMySql
- Linux上yum安裝mysql5.6LinuxMySql
- centos(linux): rpm -V 驗證rpm包安裝程式的安全CentOSLinux
- mysql安裝(rpm)MySql
- Linux RPM包安裝、解除安裝、升級命令講解Linux
- Mysql 5.7在OL 6上以RPM包安裝MySql
- Linux rpm -e --nodeps rpm解除安裝Linux
- CentOS 安裝 mysql 5.6CentOSMySql
- Windows 安裝 MySQL 5.6WindowsMySql
- yum如何解除安裝已安裝的rpm並安裝本地rpm包
- MySQL 5.7.22 rpm 安裝方式MySql
- rpm包安裝升級與解除安裝
- RPM包安裝與介紹
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)線上安裝方式LinuxRedhatCentOSMySql
- 在Linux(Redhat/CentOS)下安裝MySQL之yum(rpm)離線安裝方式LinuxRedhatCentOSMySql
- RPM包的安裝與升級
- Linux命令之rpm安裝命令Linux
- Windows 安裝並配置 MySQL 5.6WindowsMySql
- linux mysql5.6版本的安裝配置過程LinuxMySql
- centOS 7 離線安裝 MySQL 5.6 完美安裝CentOSMySql
- 透過yum在centos6.6上安裝mysql5.7.21rpm包CentOSMySql
- Greenplum_原始碼編譯安裝和RPM包安裝原始碼編譯
- 在linux(Centos 7以上版本親測)上安裝mysql5.6LinuxCentOSMySql
- yum/dnf/rpm 等 檢視rpm 包安裝路徑 (fedora 中 pygtk 包內容安裝到哪裡了)
- centos以RPM包方式安裝redis的方法CentOSRedis
- 在 Fedora 中安裝替代版本的 RPM 包
- yum安裝軟體之後如何儲存rpm安裝包
- CentOS8 安裝 MySQL8.0(RPM)CentOSMySql
- Linux之RPM包管理_RPM包查詢Linux
- CentOS 6.7下yum方式安裝MySQL 5.6CentOSMySql
- Linux rpm查詢命令以及RPM包驗證Linux
- CentOS7離線安裝(rpm安裝)mysql資料庫CentOSMySql資料庫
- rpm:虛擬包:空白包:欺騙包:do nothing包:滿足現有rpm包安裝依賴的要求
- Linux自己製作rpm包Linux