1. 程式人生 > >CentOS7安裝MySQL5.6.27資料庫

CentOS7安裝MySQL5.6.27資料庫

#####################CentOS7安裝MySQL資料庫############################

檢視linux系統資訊:

CentOS-7-x86_64-DVD-1503-01.iso

MySQL-client-5.6.27-1.el6.x86_64.rpm 
MySQL-devel-5.6.27-1.el6.x86_64.rpm 
MySQL-server-5.6.27-1.el6.x86_64.rpm

[[email protected] etc]# cat /etc/issue
\S
Kernel \r on an \m
[[email protected]
etc]# uname -a Linux localhost.localdomain 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux [[email protected] etc]# cat /proc/version Linux version 3.10.0-229.el7.x86_64 ([email protected]) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Fri Mar 6 11:36:42 UTC 2015

1:檢查是否安裝MySQL:

方法1:

[[email protected] ~]# yum list installed mysql*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.btte.net
 * extras: mirrors.btte.net
 * updates: mirrors.opencas.cn
Error: No matching Packages to list
方法2:
[[email protected] ~]# rpm -qa | grep -i mysql
[
[email protected]
~]#
2:檢視yum伺服器可下載mysql的版本資訊:
[[email protected] ~]# yum list | grep mysql
3:看著yum伺服器有沒有合適的安裝包:
[[email protected] ~]# yum list mysql*
安裝前:注:之前安裝過MySQL或者有殘留,請檢視:CentOS下MySQL的徹底解除安裝 4:yum安裝MySQL:
 #安裝MySQL客戶端
 [[email protected] ~]# yum install mysql
 #安裝MySQL服務端
 [[email protected] ~]# yum install mysql-server
 #安裝MySQL的庫和標頭檔案
 [[email protected] ~]# yum install mysql-devel
5:rpm安裝MySQL: 2:已準備安裝rpm檔案:
[[email protected] install-files]# pwd
/home/install-files
[[email protected] install-files]# ll
總用量 241452
-rw-r--r--. 1 root root   9106353 10月  8 23:15 apache-tomcat-8.0.24.tar.gz
-rw-r--r--. 1 root root 160084320 10月  8 23:17 jdk-8u60-linux-x64.rpm
-rw-r--r--. 1 root root  18596528 10月 11 13:24 MySQL-client-5.6.27-1.el6.x86_64.rpm
-rw-r--r--. 1 root root   3392620 10月 11 13:24 MySQL-devel-5.6.27-1.el6.x86_64.rpm
-rw-r--r--. 1 root root  55950588 10月 11 13:25 MySQL-server-5.6.27-1.el6.x86_64.rpm
-rw-r--r--. 1 root root     98362 10月  8 23:45 sshpass-1.05.tar.gz3
3:安裝MySQL服務端:
[[email protected] install-files]# rpm -ivh MySQL-server-5.6.27-1.el6.x86_64.rpm --nosignature
Preparing...                          ################################# [100%]
Updating / installing...
   1:MySQL-server-5.6.27-1.el6        ################################# [100%]
……………………
省略log,文章後備注附件。
檢查:
[[email protected] bin]# mysql --version
mysql  Ver 14.14 Distrib 5.6.27, for Linux (x86_64) using  EditLine wrapper
問題1:file /usr/share/mysql/charsets/README from install of MySQL-server-5.6.27-1.el6.x86_64 conflicts with file from package mariadb-libs-1:5.5.41-2.el7_0.x86_64………
問題2:warning: MySQL-server-5.5.46-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY 問題3:mysqld: unrecognized service 問題4:FATAL ERROR: please install the following Perl modules before executing /usr/bin/mysql_install_db:  Data::Dumper 問題5:Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid). 4:安裝MySQL的庫和標頭檔案:
[[email protected] install-files]# rpm -ivh MySQL-devel-5.6.27-1.el6.x86_64.rpm --nosignature
Preparing...                          ################################# [100%]
Updating / installing...
   1:MySQL-devel-5.6.27-1.el6         ################################# [100%]

5:安裝MySQL客戶端:
[[email protected] install-files]# rpm -ivh MySQL-client-5.6.27-1.el6.x86_64.rpm --nosignature
Preparing...                          ################################# [100%]
Updating / installing...
   1:MySQL-client-5.6.27-1.el6        ################################# [100%]
檢驗:
[[email protected] bin]# find /usr/bin -name mysqladmin
/usr/bin/mysqladmin
[[email protected] bin]# find /usr/bin -name mysqldump
/usr/bin/mysqldump

注:以下操作rpm和yum安裝完成之後操作為一致。 以上安裝為預設路徑安裝,如果要設定路徑rpm引數(--relocate,--badreloc):
mysql安裝目錄:
 1.資料庫目錄
 /var/lib/mysql/
 2.配置檔案
 /usr/share/mysql(mysql.server命令及配置檔案)
 3.啟動指令碼
 /etc/rc.d/init.d/(啟動指令碼檔案mysql的目錄) 
 4.相關命令
 /usr/bin(mysqladmin mysqldump等命令)


 注:1~3安裝server安裝後存在,4mysqladmin mysqldump在client安裝後存在 6:啟動和關閉mysql:
[[email protected] init.d]# pwd
/etc/rc.d/init.d
[[email protected] init.d]# ls
functions  jexec  mysql  netconsole  network  README
[[email protected] install-files]# service mysql start
Starting MySQL.. SUCCESS! 
[[email protected] install-files]# service mysql stop
Shutting down MySQL.. SUCCESS! 
這個版本安裝的mysql的啟動指令碼為mysql而非mysqld。 問題: 問題3:mysqld: unrecognized service 問題5:Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid). 檢視MySQL日誌: cat /var/log/messages | grep mysqld 檢視路徑,檢查檔案是否缺少:/var/lib/mysql/
[[email protected] mysql]# ll
total 110620
-rw-rw----. 1 mysql mysql       56 Oct 11 23:20 auto.cnf
-rw-rw----. 1 mysql mysql 12582912 Oct 11 23:20 ibdata1
-rw-rw----. 1 mysql mysql 50331648 Oct 11 23:20 ib_logfile0
-rw-rw----. 1 mysql mysql 50331648 Oct 11 23:19 ib_logfile1
-rw-r-----. 1 mysql root      5847 Oct 11 23:20 localhost.localdomain.err
drwx--x--x. 2 mysql mysql     4096 Oct 11 23:19 mysql
drwx------. 2 mysql mysql     4096 Oct 11 23:19 performance_schema
-rw-r--r--. 1 root  root       111 Oct 11 23:19 RPM_UPGRADE_HISTORY
-rw-r--r--. 1 mysql mysql      111 Oct 11 23:19 RPM_UPGRADE_MARKER-LAST
drwxr-xr-x. 2 mysql mysql        6 Oct 11 23:19 test
 備註附件:
[[email protected] install-files]# tar -xvf MySQL-5.6.22-1.linux_glibc2.5.x86_64.rpm-bundle.tar
 MySQL-shared-compat-5.6.22-1.linux_glibc2.5.x86_64.rpm     #RHEL相容包 
 MySQL-client-5.6.22-1.linux_glibc2.5.x86_64.rpm       #MySQL客戶端程式
 MySQL-shared-5.6.22-1.linux_glibc2.5.x86_64.rpm    #MySQL的共享庫
 MySQL-server-5.6.22-1.linux_glibc2.5.x86_64.rpm        #MySQL服務端程式
 MySQL-test-5.6.22-1.linux_glibc2.5.x86_64.rpm        #MySQL的測試元件
 MySQL-devel-5.6.22-1.linux_glibc2.5.x86_64.rpm        #MySQL的庫和標頭檔案
 MySQL-embedded-5.6.22-1.linux_glibc2.5.x86_64.rpm       #MySQL的嵌入式程式

備註安裝成功日誌:
2015-10-11 23:19:40 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-10-11 23:19:40 0 [Note] /usr/sbin/mysqld (mysqld 5.6.27) starting as process 3168 ...
2015-10-11 23:19:40 3168 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-10-11 23:19:40 3168 [Note] InnoDB: The InnoDB memory heap is disabled
2015-10-11 23:19:40 3168 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-10-11 23:19:40 3168 [Note] InnoDB: Memory barrier is not used
2015-10-11 23:19:40 3168 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-10-11 23:19:40 3168 [Note] InnoDB: Using Linux native AIO
2015-10-11 23:19:40 3168 [Note] InnoDB: Using CPU crc32 instructions
2015-10-11 23:19:40 3168 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-10-11 23:19:40 3168 [Note] InnoDB: Completed initialization of buffer pool
2015-10-11 23:19:40 3168 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2015-10-11 23:19:40 3168 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2015-10-11 23:19:40 3168 [Note] InnoDB: Database physically writes the file full: wait...
2015-10-11 23:19:40 3168 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2015-10-11 23:19:41 3168 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2015-10-11 23:19:43 3168 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2015-10-11 23:19:43 3168 [Warning] InnoDB: New log files created, LSN=45781
2015-10-11 23:19:43 3168 [Note] InnoDB: Doublewrite buffer not found: creating new
2015-10-11 23:19:43 3168 [Note] InnoDB: Doublewrite buffer created
2015-10-11 23:19:43 3168 [Note] InnoDB: 128 rollback segment(s) are active.
2015-10-11 23:19:43 3168 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-10-11 23:19:43 3168 [Note] InnoDB: Foreign key constraint system tables created
2015-10-11 23:19:43 3168 [Note] InnoDB: Creating tablespace and datafile system tables.
2015-10-11 23:19:43 3168 [Note] InnoDB: Tablespace and datafile system tables created.
2015-10-11 23:19:43 3168 [Note] InnoDB: Waiting for purge to start
2015-10-11 23:19:43 3168 [Note] InnoDB: 5.6.27 started; log sequence number 0
A random root password has been set. You will find it in '/root/.mysql_secret'.
2015-10-11 23:19:44 3168 [Note] Binlog end
2015-10-11 23:19:44 3168 [Note] InnoDB: FTS optimize thread exiting.
2015-10-11 23:19:44 3168 [Note] InnoDB: Starting shutdown...
2015-10-11 23:19:46 3168 [Note] InnoDB: Shutdown completed; log sequence number 1625977

2015-10-11 23:19:46 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-10-11 23:19:46 0 [Note] /usr/sbin/mysqld (mysqld 5.6.27) starting as process 3190 ...
2015-10-11 23:19:46 3190 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-10-11 23:19:46 3190 [Note] InnoDB: The InnoDB memory heap is disabled
2015-10-11 23:19:46 3190 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-10-11 23:19:46 3190 [Note] InnoDB: Memory barrier is not used
2015-10-11 23:19:46 3190 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-10-11 23:19:46 3190 [Note] InnoDB: Using Linux native AIO
2015-10-11 23:19:46 3190 [Note] InnoDB: Using CPU crc32 instructions
2015-10-11 23:19:46 3190 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-10-11 23:19:46 3190 [Note] InnoDB: Completed initialization of buffer pool
2015-10-11 23:19:46 3190 [Note] InnoDB: Highest supported file format is Barracuda.
2015-10-11 23:19:46 3190 [Note] InnoDB: 128 rollback segment(s) are active.
2015-10-11 23:19:46 3190 [Note] InnoDB: Waiting for purge to start
2015-10-11 23:19:46 3190 [Note] InnoDB: 5.6.27 started; log sequence number 1625977
2015-10-11 23:19:46 3190 [Note] Binlog end
2015-10-11 23:19:46 3190 [Note] InnoDB: FTS optimize thread exiting.
2015-10-11 23:19:46 3190 [Note] InnoDB: Starting shutdown...
2015-10-11 23:19:49 3190 [Note] InnoDB: Shutdown completed; log sequence number 1625987

A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.
This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings
大概安裝步驟:
[[email protected] install-files]# rpm -ivh MySQL-client-5.6.27-1.el6.x86_64.rpm --nosignature
……
[[email protected] install-files]# rpm -ivh MySQL-devel-5.6.27-1.el6.x86_64.rpm --nosignature
……
[[email protected] install-files]# yum remove mysql-libs
……
[[email protected] lib]# rm -rf /var/lib/mysql
……
[[email protected] install-files]# yum install -y perl-Module-Install.noarch
……
[[email protected] install-files]# rpm -ivh MySQL-server-5.6.27-1.el6.x86_64.rpm --nosignature
……

相關推薦

CentOS7安裝MySQL5.6.27資料庫

#####################CentOS7安裝MySQL資料庫############################ 檢視linux系統資訊: CentOS-7-x86_64-DVD-1503-01.iso MySQL-client-5.6.27-1.el6

ubuntu15.04手動安裝MySQL5.6.27資料庫

ubuntu15.04手動安裝MySQL5.6.27資料庫 1.手動安裝的原因 使用apt-get install mysql-server命令安裝MySQL的時候,環境變數已經配好了, 但是由於配

centos7-安裝mysql5.6.36

本地 目錄 names date 位置 download 啟動 ase 出現 本地安裝了mysql5.7, 但和springboot整合jpa時會出現 hibernateException, 不知道為什麽, 換個mysql5.6版本的mysql, 源碼安裝, cmake一

centos7 安裝mysql5.6 以及部分優化

centos7 安裝mysqlhostnamectl set-hostname mysql [[email protected]/* */ ~]# rpm -qa mariadb* mariadb-libs-5.5.44-2.el7.centos.x86_64 [[email p

centos7安裝Mysql5.6

create enter com hang AI per please 刪除 替換 一. 卸載   先卸載centos7自帶的mariadb數據庫(MariaDB數據庫管理系統是MySQL的一個分支),如果不卸載掉他的話,那麽我們安裝的mysql數據庫是運行不起來的!  

centos7安裝mysql5.6成功

vim /etc/rc.local 2 新增service mysqld start centos7下使用yum安裝mysql CentOS7的yum源中預設好像是沒有mysql的。為了解決這個問題,我們要先下載mysql的repo源。 1. 下載mysql的repo源 $&nbs

Centos7安裝MySQL5.6.26

一,解除安裝自帶MySQL yum remove -y mysql mysql-devel mysql-server 二,安裝MySQL-5.6.26 [[email protected] ~]# cd /usr/src/ [[email protected] src]#&nbs

CentOS7 安裝MySQL5.6

1.  檢查是否有MariaDB和MySQL,如果有則解除安裝掉 [[email protected]192-168-7-77 ~]# rpm -qa | egrep "mariadb|mysql" mariadb-server-5.5.60-1.el7_5.x86_64

記錄阿里雲linux centos7安裝mysql5.6 tar.gz

1.刪除mariadb和mysql mariadb是mysql的一個分支,但要安裝mysql需要刪除它 執行rpm -qa|grep mariadb,檢視mariadb情況,有就刪除 rpm -e -nodeps mariadb....名字 檢視是否已經有mysql

Centos7 安裝mysql5.6穩定版

安裝分為兩個大的步驟      第一,從當前系統中徹底刪除MySQL      第二,重新從yum源安裝mysql 1.徹底刪除MySQL     關鍵問題:需要安裝每一個包以及依賴的包,如果當前包在刪除的時候顯示被其他包依賴,那麼需要先刪除被該包所依賴的包,使用rpm命

CentOS7安裝MySQL5.6.28及其修改密碼

在大二的Linux課程設計上基於CentOS7做過MySQL主從備份,在CentOS7上已經使用mariadb代替了MySQL。因此使用yum install mysql實際上安裝的是mariadb. 最近做測試需要安裝MySQL,本著快速的原則使用了rpm

linux-centos7安裝mysql5.6

cimage leg 腳本 bsp groupadd 查找 format color 繼續 環境: 1、操作系統:Centos 7.2 2、安裝版本: mysql-5.6.43-linux-glibc2.12-x86_64.tar.gz 3、下載方式:官網下載即可:ht

centos7上以RPM方式安裝MySQL5.6

eve 刷新 ftp -i 遠程 span 查找 /var/ load 1. 下載MySQL http://ftp.ntu.edu.tw/MySQL/Downloads/MySQL-5.6/ MySQL-5.6.36-1.el7.src.rpm MySQL-5.6.36-1

Linux系統 Centos7 yum命令在線安裝 MySQL5.6

yum安裝mysql rpm包現在Centos7的yum源中 沒有mysql,可以直接安裝。用了MariaDB 代替了。那我們如果要裝MySQL數據庫,可以用以下方法# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

Centos7 編譯安裝mysql5.6

utf mys datadir ext sed ets div source soc   安裝目錄:/usr/local/mysql5.6   數據庫目錄 : /data/mysql/data mysql安裝包:http://dev.mysql.com/get

CentOS7.x使用yum安裝Mysql5.6

cal service 完成後 root賬戶 res 存在 要去 restart 檢查 先檢查是否存在已安裝的MySQL # yum list installed | grep mysql 若存在刪除: yum remove 軟件名稱 CentOS 7的yum源中沒

CentOS7.4上2分鐘快速安裝MySQL5.6

設置 serve hat 腳本 please word cto efault loading 一、環境介紹: 騰訊雲雲主機全新環境安裝MySQL5.6.39 [root@VM_82_178_centos scripts]# cat /etc/redhat-release

centos7安裝Mysql5.6(yum方式)

參考部落格:[阿里雲Centos7使用yum安裝MySQL5.6] (https://blog.csdn.net/u011627980/article/details/52691799) 一、安裝 大家都知道,centos自帶的repo是不會自動更新每個軟體的最新版本,所以無法通

centos7安裝Mysql5.6(原始碼方式)

Mysql安裝和配置 我使用原始碼編譯的形式來安裝mysql,使用的mysql5.6。 1.下載 wget https://cdn.mysql.com//Downloads/MySQL-5.6/mysql-5.6.40.tar.gz 2.解除安裝自帶mysql 因為mys

Centos7.2環境RPM 安裝MySQL5.6.24

系統環境 CentOS Linux release 7.2.1511 (Core) 1.關閉selinux 服務 [[email protected]~]# vim /etc/selinux/config  ··· SELINUX=disabled ··· 2.