当前位置:网站首页>Source code compilation and installation of MySQL
Source code compilation and installation of MySQL
2022-07-04 13:50:00 【Ink dyeing 866】
System environment :CentOS7.9
The following is the process of compiling and installing
The installation package is placed at the end of the article , Self taking
Installation preparation : Upload compressed package
cmake-3.6.2.tar.gz
boost_1_59_0.tar.gz
mysql-5.7.37.tar.gz
yum install -y openssl* # Install dependency packages
yum install -y ncurses-devel* libtirpc* rpcgen*
yum install -y gcc*
# Upload installation package
cd /usr/local/src
rz cmake-3.6.2.tar.gz
rz boost_1_59_0.tar.gz
rz mysql-5.7.37.tar.gz
1) Install dependency packages
# Compilation and installation cmake
cd /usr/local/src
tar -xvf cmake-3.6.2.tar.gz
cd cmake-3.6.2
./bootstrap
gmake && gmake install
ln -s /usr/local/bin/cmake /usr/bin/
which cmake # verification cmkae Is the installation successful
# Compilation and installation boost
cd /usr/local/src
tar -xvf boost_1_59_0.tar.gz
mv /usr/local/src/boost_1_59_0 ../boost
2) install MySQL
# Compilation and installation mysql
mkdir -pv /usr/local/mysql/data
useradd -s /sbin/nologin -r mysql
cd /usr/local/src
tar -xvf mysql-5.7.37.tar.gz
cd mysql-5.7.37
cmake . -DCMAKE\_INSTALL\_PREFIX=/usr/local/mysql -DMYSQL\_DATADIR=/usr/local/mysql/data/ -DMYSQL\_UNIX\_ADDR=/usr/local/mysql/mysql.sock -DWITH\_INNOBASE\_STORAGE\_ENGINE=1 -DWITH\_MYISAM\_STORAGE\_ENGINE=1 -DENABLED\_LOCAL\_INFILE=1 -DEXTRA\_CHARSETS=all -DDEFAULT\_CHARSET=utf8 -DDEFAULT\_COLLATION=utf8\_general\_ci -DMYSQL\_USER=mysql -DWITH\_DEBUG=0 -DWITH\_EMBEDDED\_SERVER=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost
make && make install
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
chown mysql.mysql /usr/local/mysql/ -R
ln -sf /usr/local/mysql/bin/\* /usr/bin/
ln -sf /usr/local/mysql/lib/\* /usr/lib/
ln -sf /usr/local/mysql/libexec/\* /usr/local/libexec
ln -sf /usr/local/mysql/share/man/man1/\* /usr/share/man/man1
ln -sf /usr/local/mysql/share/man/man8/\* /usr/share/man/man8
vim /etc/my.cnf
Input :
[mysqld]
datadir=/usr/local/mysql/data
socket=/usr/local/mysql/mysql.sock
symbolic-links=0
default_authentication_plugin=mysql_native_password
[mysqld\_safe]
log-error=/var/log/mysql.log
pid-file=/var/run/mysql.pid
!includedir /etc/my.cnf.d
#my.cnf Directories and files in must exist
touch /var/log/mysql.log
chown mysql:mysql /var/log/mysql.log
touch /var/run/mysql.pid
chown mysql:mysql /var/run/mysql.pid
mkdir /etc/my.cnf.d
# Add to global variable
vim /etc/profile
Input :
export PATH=$PATH:/usr/local/mysql/bin
source /etc/profile
# Initialize database
/usr/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
service mysql start
mysql -uroot -p # Connect to database
set password='XXXXX'; # Change Password
exit
mysql -uroot -p'XXXXX' # Connect and log in to the database
Finally, entering this interface indicates that the installation is successful

software package :
link :https://pan.baidu.com/s/1ivw9Rzxf3Bd-k7HIJJxUcQ
Extraction code :AK47
边栏推荐
猜你喜欢

HAProxy高可用解决方案

诸神黄昏时代的对比学习

Samsung's mass production of 3nm products has attracted the attention of Taiwan media: whether it can improve the input-output rate in the short term is the key to compete with TSMC

Flet教程之 03 FilledButton基础入门(教程含源码)(教程含源码)

2022G3锅炉水处理考试题模拟考试题库及模拟考试

【AI系统前沿动态第40期】Hinton:我的深度学习生涯与研究心法;Google辟谣放弃TensorFlow;封神框架正式开源

CANN算子:利用迭代器高效实现Tensor数据切割分块处理
Efficient! Build FTP working environment with virtual users

实战:fabric 用户证书吊销操作流程

Annual comprehensive analysis of China's mobile reading market in 2022
随机推荐
Deploy halo blog with pagoda
Scripy framework learning
【AI系统前沿动态第40期】Hinton:我的深度学习生涯与研究心法;Google辟谣放弃TensorFlow;封神框架正式开源
Go 语言入门很简单:Go 实现凯撒密码
C language staff management system
N++ is not reliable
诸神黄昏时代的对比学习
JVM series - stack and heap, method area day1-2
ASP.NET Core入门一
Excuse me, have you encountered this situation? CDC 1.4 cannot use timestamp when connecting to MySQL 5.7
Runc hang causes the kubernetes node notready
unity不识别rider的其中一种解决方法
[FAQ] summary of common causes and solutions of Huawei account service error 907135701
After the game starts, you will be prompted to install HMS core. Click Cancel, and you will not be prompted to install HMS core again (initialization failure returns 907135003)
面试官:Redis中哈希数据类型的内部实现方式是什么?
实战:fabric 用户证书吊销操作流程
remount of the / superblock failed: Permission denied
光环效应——谁说头上有光的就算英雄
CommVault cooperates with Oracle to provide metallic data management as a service on Oracle cloud
FS4056 800mA充电ic 国产快充电源ic