当前位置:网站首页>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
边栏推荐
- A data person understands and deepens the domain model
- Using nsproxy to forward messages
- ViewBinding和DataBinding的理解和区别
- Three schemes to improve the efficiency of MySQL deep paging query
- c#数组补充
- Introduction to reverse debugging PE structure resource table 07/07
- Scrapy 框架学习
- Optional values and functions of the itemized contenttype parameter in the request header
- Cors: standard scheme of cross domain resource request
- 字节面试算法题
猜你喜欢
OPPO Find N2产品形态首曝:补齐各项短板
"Pre training weekly" issue 52: shielding visual pre training and goal-oriented dialogue
8 expansion sub packages! Recbole launches 2.0!
CA: efficient coordinate attention mechanism for mobile terminals | CVPR 2021
分布式BASE理论
三星量产3纳米产品引台媒关注:能否短期提高投入产出率是与台积电竞争关键
[cloud native | kubernetes] in depth understanding of ingress (12)
基于链表管理的单片机轮询程序框架
实战:fabric 用户证书吊销操作流程
Golang sets the small details of goproxy proxy proxy, which is applicable to go module download timeout and Alibaba cloud image go module download timeout
随机推荐
unity不识别rider的其中一种解决方法
Node の MongoDB 安装
In 2022, it will be es2022 soon. Do you only know the new features of ES6?
Reading cognitive Awakening
CommVault cooperates with Oracle to provide metallic data management as a service on Oracle cloud
C language staff management system
How real-time cloud interaction helps the development of education industry
三星量产3纳米产品引台媒关注:能否短期提高投入产出率是与台积电竞争关键
Interviewer: what is the difference between redis expiration deletion strategy and memory obsolescence strategy?
Node の MongoDB安装
N++ is not reliable
微服务入门
Commvault 和 Oracle 合作,在 Oracle 云上提供 Metallic数据管理即服务
室外LED屏幕防水吗?
Comprehensive evaluation of modular note taking software: craft, notation, flowus
7 月数据库排行榜:MongoDB 和 Oracle 分数下降最多
PostgreSQL 9.1 soaring Road
实战:fabric 用户证书吊销操作流程
iptables基础及Samba配置举例
Cors: standard scheme of cross domain resource request