本文主要给大家介绍mysql5.7编译安装流程简析,希望可以给大家补充和更新些知识,如有其它问题需要了解的可以持续在亿速云行业资讯里面关注我的更新文章的。
mysql5.7编译安装过程
mkdir -p /data/{mysql,conf}
cd /usr/local/src
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.22.tar.gz
tar xf mysql-5.7.22.tar.gz
wget http://www.sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz
tar -zxvf boost_1_59_0.tar.gz -C /usr/local
mv /usr/local/boost_1_59_0 /usr/local/boost
#安装
yum -y groupinstall "Development tools"
yum -y install wget iproute iotop mtr perf telnet dstat iftop vim cmake gcc gcc-c++ bison ncurses ncurses-devel
yum -y install libxml2 libxml2-devel openssl-devel bzip2 bzip2-devel libcurl-devel libjpeg libjpeg-devel libpng-devel libicu-devel libmcrypt-devel freetype-devel libtidy libtidy-devel ImageMagick-devel mhash mhash-devel pcre-devel libzip postgresql-devel
groupadd -g 306 mysql
useradd -g mysql -u 306 -s /sbin/nologin -M mysql
mkdir /data/mysql -pv
chown -R mysql.mysql /data/mysql
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DWITH_BOOST=/usr/local/boost -DSYSCONFDIR=/etc -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DENABLE_DTRACE=0 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EMBEDDED_SERVER=1
make && make install
#设置权限
chown -R mysql:mysql /data/mysql
vim /etc/my.cnf
[mysqld]
port=3306
basedir=/usr/local/mysql
datadir=/data/mysql
character-set-server=utf8
default-storage-engine=InnoDB
max_connections=5120
query_cache_size=0
tmp_table_size=18M
log-error = /data/mysql/mysql-error.log
thread_cache_size=8
myisam_max_sort_file_size=64G
myisam_sort_buffer_size=35M
key_buffer_size=25M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=256K
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=1M
innodb_buffer_pool_size=47M
innodb_log_file_size=24M
innodb_thread_concurrency=8
/usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql
echo "export PATH=/usr/local/mysql/bin:$PATH" >> /etc/profile
source /etc/profile
ln -sv /usr/local/mysql/include /usr/include/mysqld
echo "/usr/local/mysql/lib" > /etc/ld.so.conf.d/mysql.conf
ldconfig
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
chkconfig --add mysqld
/etc/init.d/mysqld start
grep "temporary password" /data/mysql/mysql-error.log
2018-09-25T06:30:28.930040Z 1 [Note] A temporary password is generated for root@localhost: Ui4/OupkjroO
mysql -uroot -pUi4/OupkjroO
mysql>alter user root@localhost identified by 'yourpassword';
看了以上关于mysql5.7编译安装流程简析,希望能给大家在实际运用中带来一定的帮助。本文由于篇幅有限,难免会有不足和需要补充的地方,如有需要更加专业的解答,可在官网联系我们的24小时售前售后,随时帮您解答问题的。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。