mysql 5.7 源码安装
groupadd mysql
useradd
mysql -g mysql -M -s
/sbin/nologin
yum
install
gcc
gcc
-c++ -y
yum
install
-y ncurses-devel
yum
install
-y cmake
yum
install
-y libaio
yum
install
-y bison
mkdir -p /data/mysql/data
chown -R mysql:mysql /data/mysql
cmake ./ -DCMAKE_INSTALL_PREFIX=/data/mysql -DMYSQL_DATADIR=/data/mysql/data -DSYSCONFDIR=/data/mysql/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_BOOST=boost
make
-j &&
make
install
修改/etc/my.cnf
初始化
./mysqld --initialize-insecure --user=mysql --basedir=/root/mysql-5.7.25 --datadir=/data/mysql/data
启动
/data/mysql/bin/mysqld_safe --user=mysql &