您好,登錄后才能下訂單哦!
這里以預編譯二進制方式安裝部署,與編譯安裝相比,不需要編譯,直接修改好my.cnf
初始化后即可使用,推薦生產(chǎn)環(huán)境使用這種方式。
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)化很多
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。