当前位置:网站首页>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
边栏推荐
- C basic supplement
- A data person understands and deepens the domain model
- Database lock table? Don't panic, this article teaches you how to solve it
- Xilinx/system-controller-c/boardui/ unable to connect to the development board, the solution of jamming after arbitrary operation
- 安装trinity、解决报错
- Comprehensive evaluation of modular note taking software: craft, notation, flowus
- 实战:fabric 用户证书吊销操作流程
- OpenHarmony应用开发之如何创建DAYU200预览器
- Iptables foundation and Samba configuration examples
- Interviewer: what is the difference between redis expiration deletion strategy and memory obsolescence strategy?
猜你喜欢
Redis —— How To Install Redis And Configuration(如何快速在 Ubuntu18.04 与 CentOS7.6 Linux 系统上安装 Redis)
2022年中国移动阅读市场年度综合分析
数据库公共字段自动填充
爬虫练习题(一)
Is the outdoor LED screen waterproof?
unity不识别rider的其中一种解决方法
Introduction to reverse debugging PE structure resource table 07/07
Flet tutorial 03 basic introduction to filledbutton (tutorial includes source code) (tutorial includes source code)
面试官:Redis中哈希数据类型的内部实现方式是什么?
Reptile exercises (I)
随机推荐
Runc hang causes the kubernetes node notready
动画与过渡效果
Meituan Ali's Application Practice on multimodal recall
2022年中国移动阅读市场年度综合分析
2022kdd pre lecture | 11 first-class scholars take you to unlock excellent papers in advance
C#基础深入学习一
SQL语言
逆向调试入门-PE结构-资源表07/07
Besides, rsync+inotify realizes real-time backup of data
C語言宿舍管理查詢軟件
Scrapy 框架学习
Excuse me, have you encountered this situation? CDC 1.4 cannot use timestamp when connecting to MySQL 5.7
数据库公共字段自动填充
微服务入门
c#数组补充
Introduction to XML III
"Tips" to slim down Seurat objects
Comparative study of the gods in the twilight Era
WPF double slider control and forced capture of mouse event focus
Zhongang Mining: in order to ensure sufficient supply of fluorite, it is imperative to open source and save flow