溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Centos7.1部署mysql-5.6.34(筆記)

發(fā)布時間:2020-06-07 03:57:37 來源:網(wǎng)絡 閱讀:825 作者:dengrenchao 欄目:MySQL數(shù)據(jù)庫

這里安裝我用的的是mysql二進制包,主要減少編譯安裝的時間,當然快的還有yum的安裝方式。

mysql個版本下載地址:http://mirrors.sohu.com/mysql/

 

1、解決相關(guān)依賴問題,否則初始化數(shù)據(jù)庫會出現(xiàn)錯誤
yum install -y perl-Module-Install.noarch libaio*


2、解壓軟件包到/usr/local/src
tar xf mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz -C /usr/local/src/

 

3、設(shè)置mysql

cd /usr/local/src/mysql-5.6.34-linux-glibc2.5-x86
ln -sv /usr/local/src/mysql-5.6.34-linux-glibc2.5-x86_64 /usr/local/mysql
cd /usr/local/mysql/
#創(chuàng)建用戶給予權(quán)限
useradd  mysql  -s /sbin/nologin
chown  -R mysql.mysql  ./* –R
#創(chuàng)建mysql的數(shù)據(jù)目錄
mkdir /data/mysql && chown  mysql.mysql /data/mysql –R
#初始化mysql
/usr/local/mysql/scripts/mysql_install_db  --user=mysql --datadir=/data/mysql --basedir=/usr/local/mysql/
#拷貝mysql的啟動文件以及配置文件
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
cp /usr/local/mysql/my.cnf  /etc/my.cnf
#設(shè)置mysql的環(huán)境變量
ln -sv /usr/local/mysql/bin/mysql /usr/bin/
#最后啟動mysql即可
/etc/init.d/mysql restart
#訪問mysql
[root@localhost ~]# /usr/local/mysql/bin/mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.6.34 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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>
向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI