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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL 5.6 RPM安裝MySql
- Percona MySQL 5.6 RPM包方式安裝流程MySql
- linux 環境RPM 安裝MYSQL5.6LinuxMySql
- MySQL之——RPM方式安裝MySQL5.6MySql
- rpm 安裝5.6 MySql主從搭建MySql
- mysql安裝------RPM包安裝及解除安裝MySql
- CentOS 6 下RPM方式安裝MySQL5.6CentOSMySql
- linux jdk rpm包安裝LinuxJDK
- Postgresql Linux版本安裝——RPM包安裝SQLLinux
- Linux rpm安裝MySQLLinuxMySql
- 基於Linux的MySQL5.7RPM包安裝LinuxMySql
- Linux安裝Mysql5.6LinuxMySql
- CentOS下使用rpm包安裝MySQLCentOSMySql
- Linux平臺(CentOS 6.5) RPM包方式安裝 Mysql 5.7LinuxCentOSMySql
- linux 安裝ps需要先安裝的rpm包Linux
- Mysql for Linux安裝配置之—— rpm(bundle)安裝MySqlLinux
- CentOS 下 MySQL 5.6 基於 RPM 的下載、安裝、配置CentOSMySql
- 【MySQL】Linux下MySQL 5.5、5.6和5.7的RPM、二進位制和原始碼安裝MySqlLinux原始碼
- mysql8.0.30的RPM包安裝方法MySql
- Linux上yum安裝mysql5.6LinuxMySql
- MySQL5.6 linux原始碼安裝MySqlLinux原始碼
- mysql安裝(rpm)MySql
- 【Linux】Linux軟體安裝管理1 rpm軟體包安裝Linux
- Mysql5.6壓縮包安裝到windows&& 解除安裝命令MySqlWindows
- Linux下用rpm方式安裝MySQLLinuxMySql
- Linux RPM包安裝、解除安裝、升級命令講解Linux
- Windows 安裝 MySQL 5.6WindowsMySql
- CentOS 安裝 mysql 5.6CentOSMySql
- Mysql 5.7在OL 6上以RPM包安裝MySql
- CentOS7.4使用rpm包安裝mysql5.7.17CentOSMySql
- Linux下MySQL5.6原始碼安裝LinuxMySql原始碼
- RPM 包安裝報錯
- rpm包安裝和管理
- centos(linux): rpm -V 驗證rpm包安裝程式的安全CentOSLinux
- linux怎樣檢視rpm安裝包的安裝路徑Linux
- yum如何解除安裝已安裝的rpm並安裝本地rpm包
- rpm包安裝升級與解除安裝
- Linux環境MySQL5.6安裝實踐LinuxMySql