MySQL8源码编译与配置

1.安装依赖包

yum install -y cmake ncurses-devel libtirpc*

2.安装boost

tar xzf boost_1_70_0.tar.gz
mv boost_1_70_0 /usr/local/boost

3.安装rpcsvc

tar zxvf rpcsvc-proto-1.4.tar.gz
cd rpcsvc-proto-1.4/
./configure
make
make install

4.下载mysql-boost 并安装

https://dev.mysql.com/downloads/mysql/

5.安装mysql-boost

tar xzf mysql-boost-8.0.18.tar.gz
cd mysql-8.0.18/
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_BOOST=/usr/local/boost -DFORCE_INSOURCE_BUILD=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
make
make install

6. mysql配置文件

/etc/my.cnf
/etc/my.cnf.d/client.cnf
/etc/my.cnf.d/mysql-default-authentication-plugin.cnf
/etc/my.cnf.d/mysql-server.cnf

7.创建mysql用户

useradd -M -s /sbin/nologin mysql
setfacl -m u:mysql:rwx -R /usr/local/mysql
setfacl -m d:u:mysql:rwx -R /usr/local/mysql

8.初始化数据库

/usr/local/mysql/bin/mysqld --initialize --user=mysql

临时密码:eyksvSSa5c*T

9. 启动服务

/usr/local/mysql/bin/mysqld_safe --user=mysql &

10. mysql服务开机启动

vi /etc/rc.local
/usr/local/mysql/bin/mysqld_safe --user=mysql &

11. 重置密码

/usr/local/mysql/bin/mysqladmin -uroot -p'HF&s#9Zped3s' password '123';
set password='123';
alter user 'root'@'localhost' identified by '123';

12.客户端登录

/usr/local/mysql/bin/mysql -uroot -p123

13.查看进程

pstree |grep mysqld

14.查看端口

netstat -tunpl |grep mysqld

15. 关闭服务

pkill mysqld

https://blog.csdn.net/zhang_referee/article/details/88212695

RIPRO主题是一个优秀的主题,极致后台体验,无插件,集成会员系统
靠谱资源下载 » MySQL8源码编译与配置

发表评论

提供最优质的资源集合

立即查看 了解详情