1. 程式人生 > >centOS 6.5 下安裝MySQL 5.6.21

centOS 6.5 下安裝MySQL 5.6.21

 1.檢視作業系統相關資訊。
[[email protected] ~]# cat /etc/issue CentOS release 6.5 (Final) Kernel \r on an \m
[[email protected] ~]# uname -a
Linux linuxidc 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
2.建立需要下載rpm軟體包的目錄。
[[email protected] ~]# mkdir -p /taokey/tools
檢視下是否有系統自帶MySQL的rpm包,如果有,需要刪除自帶的舊rpm包。
[[email protected] ~]# rpm -qa | grep mysql-libs-5.1.71-1.el6.x86_64
[[email protected] ~]# yum -y remove mysql-libs-5.1*
[[email protected] ~]# rpm -qa | grep mysql
4.在MySQL官網下載安裝MySQL-5.6.21所需的rpm軟體包。
需要下載三個rpm軟體包:
MySQL-client-5.6.21-1.rhel5.x86_64.rpm  
MySQL-devel-5.6.21-1.rhel5.x86_64.rpm  
MySQL-server-5.6.21-1.rhel5.x86_64.rpm
[
[email protected]
uxidc ~]# cd /taokey/tools/ [[email protected] tools]#wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.rhel5.x86_64.rpm [[email protected] tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.rhel5.x86_64.rpm [[email protected] tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.rhel5.x86_64.rpm
5.下載完之後,安裝三個rpm軟體包。
5.1如果提示需要安裝perl:

[[email protected] tools]#yum install perl
5.2安裝下載的軟體包:
[[email protected] tools]# rpm -ivh MySQL-client-5.6.21-1.rhel5.x86_64.rpm  
[[email protected] tools]# rpm -ivh MySQL-devel-5.6.21-1.rhel5.x86_64.rpm
[[email protected] tools]# rpm -ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-server           ########################################### [100%]
………………
………………
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
在安裝MySQL-server,見上面的一段話,

大意是全新安裝設定的root密碼在/root/.mysql_secret中,這是一個隨機密碼,你需要執行/usr/bin/mysql_secure_installation,刪除anonymous使用者。當然不建議用root使用者來執行,rpm包已經建了一個mysql使用者,可以使用這個使用者:

[[email protected] tools]#more /root/.mysql_secret
# The random password set for the root user at Tue Nov 18 22:57:46 2014 (local t
ime): NljqL63OYlGo5cqy    <– 得到root訪問mysql的密碼:NljqL63OYlGo5cqy
# service mysql start
Starting MySQL... SUCCESS!
[[email protected] tools]# /usr/bin/mysql_secure_installation --user=mysql
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
 
In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
 
Enter current password for root (enter for none):    <–使用剛才得到的root的密碼 NljqL63OYlGo5cqy
OK, successfully used password, moving on...
 
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
 
You already have a root password set, so you can safely answer 'n'.
 
Change the root password? [Y/n] y   <– 是否更換root使用者密碼,輸入y並回車,強烈建議更換
New password:      <– 設定root使用者的密碼
Re-enter new password:    <– 再輸入一次你設定的密碼
Password updated successfully!
Reloading privilege tables..
 ... Success!
 
 
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
 
Remove anonymous users? [Y/n] y   <– 是否刪除匿名使用者,生產環境建議刪除,所以輸入y並回車
 ... Success!
 
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
 
Disallow root login remotely? [Y/n] y    <–是否禁止root遠端登入,根據自己的需求選擇Y/n並回車,建議禁止
 ... Success!
 
By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
 
Remove test database and access to it? [Y/n] y    <– 是否刪除test資料庫,輸入y並回車
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!
 
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
 
Reload privilege tables now? [Y/n] y   是否重新載入許可權表,輸入y並回車
 ... Success!
 
 
 
 
All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.
 
Thanks for using MySQL!
 
 
Cleaning up...
至此,MySQL已經安裝完成,最後看一下是否已將MySQL加到開機服務裡:
[[email protected] tools]#  chkconfig
auditd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
blk-availability        0:off   1:on    2:on    3:on    4:on    5:on    6:off
crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off
ip6tables       0:off   1:off   2:on    3:on    4:on    5:on    6:off
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
iscsi           0:off   1:off   2:off   3:on    4:on    5:on    6:off
iscsid          0:off   1:off   2:off   3:on    4:on    5:on    6:off
lvm2-monitor    0:off   1:on    2:on    3:on    4:on    5:on    6:off
mdmonitor       0:off   1:off   2:on    3:on    4:on    5:on    6:off
multipathd      0:off   1:off   2:off   3:off   4:off   5:off   6:off
mysql           0:off   1:off   2:on    3:on    4:on    5:on    6:off   <-看到這個OK了
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
postfix         0:off   1:off   2:on    3:on    4:on    5:on    6:off
rdisc           0:off   1:off   2:off   3:off   4:off   5:off   6:off
restorecond     0:off   1:off   2:off   3:off   4:off   5:off   6:off
rsyslog         0:off   1:off   2:on    3:on    4:on    5:on    6:off
saslauthd       0:off   1:off   2:off   3:off   4:off   5:off   6:off
sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
udev-post       0:off   1:on    2:on    3:on    4:on    5:on    6:off
 MySQL安裝後涉及的目錄如下:

目錄目錄中的內容
/usr/bin	客戶端程式和指令碼
/usr/sbin	Mysqld伺服器
/var/lib/mysql	資料庫的日誌檔案
/usr/share/info	資訊格式手冊
/usr/share/man	Unix 手冊頁
/usr/include/mysql	包括 (標題) 的檔案
/usr/lib/mysql	mysql的lib包
/usr/share/mysql	雜項的支援檔案,包括錯誤訊息) 字元設定的檔案,示例配置檔案,SQL 資料庫安裝
/usr/share/sql-bench	基準
現在好了,可以測試你的MySQL了。

相關推薦

CentOS 6.8 安裝mysql-5.6

centos6.8 mysql 源碼CentOS 6.8 下安裝mysql-5.6安裝環境:CentOS release 6.8 (Final) percona-server-5.6.29-76.2安裝依賴庫和工具yum -y install gcc gcc-c++ libgcrypt openssl op

CentOS 6 5 安裝MySQL 5 7 12,使用官網下載的rpm安裝

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!        

centOS 6.5 安裝MySQL 5.6.21

 1.檢視作業系統相關資訊。[[email protected] ~]# cat /etc/issue CentOS release 6.5 (Final) Kernel \r on an \m [[email protected] ~]# uname

CentOS 7.3安裝MySQL 5.7

1、 下載 選擇你需要安裝的版本,這裡我的電腦是CentOS7.3 64位 然後下載 RPM Bundle,這個是幾個程式的合集包。 然後開始下載。。。。 2、 解壓安裝包 解壓mysql-5.7.20-1.el7.x86_64.rp

CentOS 6.9上安裝mysql-5.6.37

初始 replica mil using logs ces def pan shutdown CentOS 6.9上安裝mysql-5.6.37 1、準備數據存放的文件系統 新建一個邏輯卷,並將其掛載至特定目錄即可。這裏不再給出過程。 這裏假設其邏輯卷的掛載目錄為/d

CentOS 6.*通過yum安裝 MySQL-5.5

tar 分享 默認值 chkconfig roo innodb mysq 設置 開機啟動 轉自https://www.cnblogs.com/wsl222000/p/5445768.html 1.安裝mysql-5.5的yum源 rpm -ivh http://repo.

轉的 CentOS 6.9上安裝MySQL 5.6.37 (我用的centos7)

inux ice x86_64 group ted repo update reads shu 記錄下在CentOS 6.9環境安裝MySQL 5.6.37的過程,供大家參考。 1、準備數據存放的文件系統新建一個邏輯卷,並將其掛載至特定目錄即可。這裏不再給出過程。這裏假設其

CentOS 6.5安裝Confluence 5.4

shell visible pri fail 文件中 false centos 6 chm var 1、主機信息 IP Confluence Server 10.64.10.2 MySQL Server 10.64.10.11 OS Conflu

windows10安裝Mysql 5.6(zip格式安裝包)

name get fff IT 需要 步驟 5.6 span packet 5.6的安裝包是一個zip文件,裏面包含了data(有表空間文件和日誌文件),bin等文件夾。不同於以往的只需要雙擊安裝.msi就行了。因此,在此記錄下安裝包是.zip時的安裝步驟。 1

Centos7.4安裝mysql-5.6.41

mys 但是 啟動mysql ann node 連接 rpm owin pack Centos7.4下安裝mysql-5.6.41二進制包 1、下載mkdir /data/sqlcd /data/sql wget https://cdn.mysql.com//Downloa

win10安裝mysql 5.6

1、在mysql官網下載mysql壓縮包 mysql-5.6.41-winx64,官網地址為:https://dev.mysql.com/downloads/file/?id=478731 2、解壓mysql-5.6.41-winx64要安裝的資料夾,我的放在C:\work\dev目錄下;

linux安裝mysql-5.6.41

target 上傳 設置 地址 .cn def mysql light 網通 1.下載安裝包,下載地址: https://dev.mysql.com/downloads/mysql/5.7.html#downloads 。選擇完版本,然後點擊下方 No thanks,

MySQL】Windows系統安裝MySQL 5.6.37(壓縮包方式)

Windows系統下安裝MySQL 5.6.37(壓縮包方式) 1、下載安裝介質 安裝介質:mysql-5.6.37-winx64.zip 下載地址:http://blog.csdn.net/kerafan/article/details/780018492、解壓安裝介質

WIN10安裝mysql-5.6.31-winx64(配置版免安裝)

1.解壓mysql-5.6.31-winx64.zip壓縮包 我是解壓到F盤下面的,然後重新命名mysql-5.6.31-winx64為mysql防止特殊字元之類的 然後會看到一個my-default.ini檔案,我們在mysql目錄下新建一個my.ini檔案內容如下

CentOS 7.2 Yum安裝MySQL 5.6

配置CentOS SCLo源 [3] 新增 CentOS SCLo Software collections Repository. [[email protected]~]# yum -y install centos-release-scl-

linux CentOS6.5 yum安裝mysql 5.6

linux centos6.5 yum安裝mysql 5.6直接按步驟安裝# wget # rpm -ivh mysql-community-release-el6-5.noarch.rpm [[email protected]/* */ ~]# yum repolist all | grep

Centos 7 安裝MySQL 5.7(yum方式)

       相信對於第一次接觸Linux系統下安裝MySQL的朋友來說,這個真的很麻煩。        我是試過用tar.gz的方式安裝,按照別人的教程 總是會出現很多輸入完指令報錯的情況。所以一個步驟一個錯誤

centos 6.0 安裝mysql

centos 6.0 下通過yum安裝mysql,這樣可以介紹一些不必要的麻煩。 1:檢視mysql版本: yum list | grep mysql 2:安裝mysql: yum install -y mysql-server mysql mysql-deve

linux安裝mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz(centos)

一  官網下載 mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz 目前最新為5.7.16,可以直接下載mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz, 這裡用的是5.7.12,未下載最新的,不過,安裝方

CentOS 7.2安裝Mono 5.0

nbsp 很好 all win ack style 領域 logs 平臺 微軟Build2017大會期間.NET領域的.NET core之外,就是Visual Studio For Mac,大家都知道Visual Studio For Mac 是基於Mono運行的,Mono