這里以預(yù)編譯二進(jìn)制方式安裝部署,與編譯安裝相比,不需要編譯,直接修改好my.cnf
初始化后即可使用,推薦生產(chǎn)環(huán)境使用這種方式。
成都創(chuàng)新互聯(lián)服務(wù)項目包括靈丘網(wǎng)站建設(shè)、靈丘網(wǎng)站制作、靈丘網(wǎng)頁制作以及靈丘網(wǎng)絡(luò)營銷策劃等。多年來,我們專注于互聯(lián)網(wǎng)行業(yè),利用自身積累的技術(shù)優(yōu)勢、行業(yè)經(jīng)驗、深度合作伙伴關(guān)系等,向廣大中小型企業(yè)、政府機構(gòu)等提供互聯(lián)網(wǎng)行業(yè)的解決方案,靈丘網(wǎng)站推廣取得了明顯的社會效益與經(jīng)濟效益。目前,我們服務(wù)的客戶以成都為中心已經(jīng)輻射到靈丘省份的部分城市,未來相信會繼續(xù)擴大服務(wù)區(qū)域并繼續(xù)獲得客戶的支持與信任!
cd ~
wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz
cat /etc/my.cnf
[client]
port = 3306
socket = /data/coohua/mysql/mysql.sock
default-character-set = utf8
[mysqld]
port = 3306
socket = /data/coohua/mysql/mysql.sock
basedir = /app/3rd/mysql/mysql
datadir = /data/coohua/mysql/data/
pid-file = /data/coohua/mysql/data/mysqld.pid
user = mysql
character-set-server =utf8
innodb_large_prefix=on
lower_case_table_names = 1
server-id = 1
groupadd mysql
useradd -g mysql -M -s /sbin/nologin mysql
mkdir -p /app/3rd/mysql
mkdir -p /data/coohua/mysql
tar -zxf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz -C /app/3rd/mysql/
ln -s /app/3rd/mysql/mysql-5.6.39-linux-glibc2.12-x86_64 /app/3rd/mysql/default
chown -R mysql.mysql /app/3rd/mysql #程序目錄
chown -R /data/coohua/mysql/ #數(shù)據(jù)目錄
cd /app/3rd/mysql/mysql-5.6.39-linux-glibc2.12-x86_64
./scripts/mysql_install_db --defaults-file=/app/3rd/mysql/default/my.cnf --user=mysql
please install the following Perl modules before executing scripts/mysql_install_db:
缺少autoconf
yum -y install autoconf
error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
缺少libaio
yum install -y libaio
./scripts/mysql_install_db --defaults-file=/app/3rd/mysql/default/my.cnf --user=mysql
/app/3rd/mysql/default/bin/mysqld_safe --defaults-file=/app/3rd/mysql/default/my.cnf --user=mysql &
./bin/mysqladmin -S /tmp/mysql.sock -u root -h localhost password 'root'
mysql -S /tmp/mysql.sock -uroot -hlocalhost -proot
delete from mysql.user where password=''; #刪除無密碼用戶
drop database test; #刪除test數(shù)據(jù)庫
至此mysql5.6版本已經(jīng)安裝完畢,但僅僅是安裝完畢,后續(xù)要的優(yōu)化很多