当前位置:网站首页>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
边栏推荐
- 嵌入式编程中五个必探的“潜在错误”
- Apache server access log access Log settings
- Flet教程之 03 FilledButton基础入门(教程含源码)(教程含源码)
- Interviewer: what is the difference between redis expiration deletion strategy and memory obsolescence strategy?
- Web knowledge supplement
- Node mongodb installation
- 上汽大通MAXUS正式发布全新品牌“MIFA”,旗舰产品MIFA 9正式亮相!
- C#/VB. Net to add text / image watermarks to PDF documents
- 用fail2ban阻止密码尝试攻
- 室外LED屏幕防水吗?
猜你喜欢

动画与过渡效果

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

Node の MongoDB安装

实时云交互如何助力教育行业发展
Efficient! Build FTP working environment with virtual users

高质量软件架构的唯一核心指标

Dgraph: large scale dynamic graph dataset

Distributed base theory

How real-time cloud interaction helps the development of education industry

CANN算子:利用迭代器高效实现Tensor数据切割分块处理
随机推荐
从0到1建设智能灰度数据体系:以vivo游戏中心为例
In 2022, it will be es2022 soon. Do you only know the new features of ES6?
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
Interviewer: what is the difference between redis expiration deletion strategy and memory obsolescence strategy?
AI painting minimalist tutorial
Rsyslog configuration and use tutorial
SQL language
E-week finance | Q1 the number of active people in the insurance industry was 86.8867 million, and the licenses of 19 Payment institutions were cancelled
舔狗舔到最后一无所有(状态机)
Rsyslog配置及使用教程
Scripy framework learning
ASP.NET Core入门一
C#基础深入学习一
Practice: fabric user certificate revocation operation process
JVM系列——栈与堆、方法区day1-2
unity不识别rider的其中一种解决方法
C#/VB. Net to add text / image watermarks to PDF documents
7 月数据库排行榜:MongoDB 和 Oracle 分数下降最多
Dgraph: large scale dynamic graph dataset
Optional values and functions of the itemized contenttype parameter in the request header