概述
一 环境准备
yum -y install wget gcc-c++ ncurses ncurses-devel cmake make perl bison openssl openssl-devel gcclibxml2 libxml2-devel curl-devel libjpeg libpngfreetype --skip-broken
yum install -y perl-Module-Install.noarch
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-boost-5.7.30.tar.gz
二关闭防火墙和selinux
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
vim /etc/selinux/config
enforcing/disabled
三创建mysql相关文件
tar -zxvf mysql-5.7.30.tar.gz
useradd -d /usr/local/mysql/ -s /sbin/nologin mysql
mkdir -p /data/mysql/data
mkdir -p /usr/local/mysql/log
chown -R mysql:mysql /data/mysql/data/
chown -R mysql:mysql /usr/local/mysql/log/
chmod 750 /data/mysql/data
chmod 750 /usr/local/mysql/log
mkdir -p /usr/local/boost
tar zxvf mysql-boost-5.7.30.tar.gz -C /usr/local/boost
四编译和安装
cd ./mysql-5.7.30
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock
-DDEFAULT_CHARSET=utf8
-DDEFAULT_COLLATION=utf8_general_ci
-DEXTRA_CHARSETS=all
-DWITH_MYISAM_STORAGE_ENGINE=1
-DWITH_INNOBASE_STORAGE_ENGINE=1
-DWITH_ARCHIVE_STORAGE_ENGINE=1
-DWITH_BLACKHOLE_STORAGE_ENGINE=1
-DWITH_MEMORY_STORAGE_ENGINE=1
-DWITH_FEDERATED_STORAGE_ENGINE=1
-DWITH_READLINE=1
-DENABLED_LOCAL_INFILE=1
-DMYSQL_DATADIR=/usr/local/mysql/data
-DMYSQL_USER=mysql
-DMYSQL_TCP_PORT=3306
-DSYSCONFDIR=/etc
-DWITH_SSL=yes
-DDOWNLOAD_BOOST=1
-DWITH_BOOST=/usr/local/boost
make && make install
五配置和初始化
ln -s /usr/local/mysql/include/mysql /usr/include/mysql
cd /usr/local/mysql
cp /etc/my.cnf /etc/my.cnf.old
vim /etc/my.cnf
datadir=/data/mysql/data
socket=/var/lib/mysql/mysql.sock
/usr/local/mysql/bin/mysqld
--initialize
--user=mysql
--datadir=/data/mysql/data/
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 35 mysqld on
echo "PATH=$PATH:/usr/local/mysql/bin;export PATH" >> /etc/profile
source /etc/profile
service mysqld restart
mysql -u root 回车
如果是5.7以下版本用
update user set password=password('123.com') where user='root';
如果是5.7以上版本则用
update user set authentication_string=password('123.com') where user='root';
flush privileges;
最后
以上就是闪闪菠萝为你收集整理的mysql5.7.30_centos7上mysql5.7.30源码编译安装的全部内容,希望文章能够帮你解决mysql5.7.30_centos7上mysql5.7.30源码编译安装所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复