数据库同步工具
sqlserver,Mysql数据同步软件

CentOS8部署LNMP环境之编译安装mysql8.0.29的教程详解

购买事宜请联系QQ:1793040

I.先决条件

因为我已经安装了几次,所以我不再报告错误了,这有点头脑风暴! ! !提前解决相关的依赖性和错误。

1.必需的源程序包

mysql-8.0.19.tar.gz

boost_1_70_0.tar.gz//安装mysql-8所需的boost版本

rpcsvc-proto-1.4.tar.gz//稍后发生错误所需的源包

mysql-8.0.19下载地址:http://mirrors.sohu.com/mysql/

Boost_1_70_0下载地址:https://dl.bintray.com/boostorg/release/1.70.0/source/

rpcsvc-proto-1.4下载地址:https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4/

2.解决依赖性

[14:41:21 root @ wangzhike] #yum install-y cmake ncurses-devel

3.存放位置

软件源代码包的存储位置:/usr/local/src

源码包安装位置:/usr/local/软件名

其次,编译并安装mysql-8.0.19

1.上传源程序包

boost_1_70_0.tar.gz

mysql-8.0.19.tar.gz

rpcsvc-proto-1.4.tar.gz

在此处插入图片描述

2.解决rpcsvc-proto-1.4

1),解压缩

[17:05:14 root @ wangzhike软件] #tar-zxf rpcsvc-proto-1.4.tar.gz-C/usr/local/src/

2),一步安装

[17:09:48 root @ wangzhike rpcsvc-proto-1.4] #https://www.jb51.net:443/article/configure \ \ make \ \ make install

3.解决boost_1_70_0

[17:13:48 root @ wangzhike]#mkdir-p/usr/local/boost

[17:14:05 root @ wangzhike]#cd/usr/local/src

[17:15:02 root @ wangzhike src] #cp/software/boost_1_70_0.tar.gz/usr/local/boost/

[17:26:22 root @ wangzhike boost] #tar xf boost_1_70_0.tar.gz

////仅上传到/usr/local/src/存储目录,解压缩到当前的boost目录

4.创建mysql用户和组

[17:27:46 root @ wangzhike] #groupadd mysql

[17:28:10 root @ wangzhike] #useradd-g mysql mysql-s/bin/false

####创建用户mysql并加入mysql组,不允许mysql用户直接登录系统

[17:28:11 root @ wangzhike] #mkdir-p/data/mysql

####创建一个MySQL数据库存储目录

[17:29:13 root @ wangzhike] #chown-R mysql:mysql/数据/mysql

####设置MySQL数据库存储目录的权限

[17:29:31 root @ wangzhike] #mkdir-p/usr/local/mysql

####创建一个MySQL安装目录

5.安装mysql-8.0.19

1),解压缩

[17:43:24 root @ wangzhike软件] #tar-zxf mysql-8.0.19.tar.gz-C/usr/local/src/

[17:43:47 root @ wangzhike软件] #cd/usr/local/src/

[17:43:53 root @ wangzhike src] #cd mysql-8.0.19/

2),安装

[17:47:01 root @ wangzhike mysql-8.0.19] #cmake。 \\\\

-DCMAKE_INSTALL_PREFIX =/usr/本地/mysql \\\\

-DINSTALL_DATADIR =/数据/mysql-DMYSQL_USER = mysql \\\\

-DMYSQL_UNIX_ADDR =/tmp/mysqld.sock-DDEFAULT_CHARSET = utf8 \\\\

-DDEFAULT_COLLATION = utf8_general_ci \\\\

-DWITH_INNOBASE_STORAGE_ENGINE = 1 \\\\

-DWITH_EMBEDDED_SERVER = 1 \\\\

-DFORCE_INSOURCE_BUILD = 1 \\\\

-DWITH_MYISAM_STORAGE_ENGINE = 1 \\\\

-DENABLED_LOCAL_INFILE = 1 \\\\

-DEXTRA_CHARSETS =全部\\\\

-DWITH_BOOST =/usr/local/boost

如果存在以下情况,则没有问题

CMake警告:
未使用手动指定的变量

项目:

EXTRA_CHARSETS

INSTALL_DATADIR

MYSQL_USER

WITH_EMBEDDED_SERVER

–构建文件已写入:/usr/local/src/mysql-8.0.19

如果出现以下有关rpc.h的错误

在/usr/include或/usr/include/tirpc

中找不到rpc/rpc.h

解决方案:

[17:45:47 root @ wangzhike mysql-8.0.19] #find/-name rpc.h

/usr/local/src/mysql-8.0.19/extra/libevent/include/event2/rpc.h

/usr/local/src/mysql-8.0.19/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/windeps/sunrpc/rpc/rpc.h

####并将/usr/local/src/mysql-8.0.19/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/windeps/sunrpc/目录中的rpc/rpc.h复制到/usr/include/

下方

[17:52:57 root @ wangzhike mysql-8.0.19] #cp-a/usr/local/src/mysql-8.0.19/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/windeps/sunrpc/rpc/usr/include/

3),安装\ \

[17:55:20 root @ wangzhike mysql-8.0.19] #make-j 3 \ \安装

//如果过程太长且内存不足,则会报告错误

等待,等待,等待

如果报告以下错误,则表明内存不足,需要创建分区

+:致命错误:终止信号cc1plus的信号被终止

编译终止。

制作[2]:*** [sql/CMakeFiles/sql_gis.dir/build.make:154:sql/CMakeFiles/sql_gis.dir/gis/distance_functor.cc.o]错误1

使[2]:***等待未完成的工作....

制作[1]:*** [CMakeFiles/Makefile2:11144:sql/CMakeFiles/sql_gis.dir/all]错误2

make:*** [Makefile:163:全部]错误2

创建分区:

[19:58:37 root @ wangzhike mysql-8.0.19] #dd if =/dev/zero of =/swapfile bs = 1k count = 2048000

2048000 + 0条记录

2048000 + 0条记录

复制的2097152000字节(2.1 GB,2.0 GiB),6.07651 s,345 MB/s

####获取要添加的2G SWAP文件块

[20:10:02 root @ wangzhike mysql-8.0.19] #mkswap/swapfile

mkswap://交换文件:不安全的权限0644,建议0600。

设置交换空间版本1,大小= 2 GiB(2097147904字节)

没有标签,UUID = 18a4bbb3-75d1-411b-ac0c-c87c63547509

####创建SWAP文件

[20:10:07 root @ wangzhike mysql-8.0.19]#swapon/swapfile

swapon:/swapfile:不安全权限0644,建议使用0600。

####激活SWAP文件

[20:10:12 root @ wangzhike mysql-8.0.19] #swapon-s

文件名类型大小使用优先级

/dev/sda2分区2144252 137300-2

/swapfile文件2047996 0-3

#####检查SWAP信息是否正确

[20:10:19 root @ wangzhike mysql-8.0.19] #echo"/var/swapfile swap swap defaults 0 0" \ gt; \ gt;/etc/fstab

####添加到fstab文件中,以使系统在系统启动时自动启动

重新执行make-j 3 \ \ make install之后,出现以下屏幕时没有错误

```重击

-安装:/usr/local/mysql/man/man1/comp_err.1

-安装:/usr/local/mysql/man/man1/ibd2sdi.1

-安装:/usr/local/mysql/man/man1/innochecksum.1

-安装:/usr/local/mysql/man/man1/lz4_decompress.1

-安装:/usr/local/mysql/man/man1/my_print_defaults.1

-安装:/usr/local/mysql/man/man1/myisam_ftdump.1

-安装:/usr/local/mysql/man/man1/myisamchk.1

-安装:/usr/local/mysql/man/man1/myisamlog.1

-安装:/usr/local/mysql/man/man1/myisampack.1

-安装:/usr/local/mysql/man/man1/mysql.1

-安装:/usr/local/mysql/man/man1/mysql.server.1

-安装:/usr/local/mysql/man/man1/mysql_config.1

-安装:/usr/local/mysql/man/man1/mysql_config_editor.1

-安装:/usr/local/mysql/man/man1/mysql_secure_installation.1

-安装:/usr/local/mysql/man/man1/mysql_ssl_rsa_setup.1

-安装:/usr/local/mysql/man/man1/mysql_tzinfo_to_sql.1

-安装:/usr/local/mysql/man/man1/mysql_upgrade.1

-安装:/usr/local/mysql/man/man1/mysqladmin.1

-安装:/usr/local/mysql/man/man1/mysqlbinlog.1

-安装:/usr/local/mysql/man/man1/mysqlcheck.1

-安装:/usr/local/mysql/man/man1/mysqld_multi.1

-安装:/usr/local/mysql/man/man1/mysqld_safe.1

-安装:/usr/local/mysql/man/man1/mysqldump.1

-安装:/usr/local/mysql/man/man1/mysqldumpslow.1

-安装:/usr/local/mysql/man/man1/mysqlimport.1

-安装:/usr/local/mysql/man/man1/mysqlman.1

-安装:/usr/local/mysql/man/man1/mysqlpump.1

-安装:/usr/local/mysql/man/man1/mysqlshow.1

-安装:/usr/local/mysql/man/man1/mysqlslap.1

-安装:/usr/local/mysql/man/man1/perror.1

-安装:/usr/local/mysql/man/man1/zlib_decompress.1

-安装:/usr/local/mysql/man/man8/mysqld.8

-安装:/usr/local/mysql/man/man1/mysqlrouter.1

-安装:/usr/local/mysql/man/man1/mysqlrouter_passwd.1

-安装:/usr/local/mysql/man/man1/mysqlrouter_plugin_info.1

三,初始化mysql数据库

1.修改mysql目录的权限

[20:37:59 root @ wangzhike mysql-8.0.19] #chown-R mysql:mysql/usr/local/mysql

[20:42:07 root @ wangzhike mysql-8.0.19] #chmod-R 755/usr/local/mysql

2.初始化mysql

[20:45:07 root @ wangzhike] #cd/usr/local/mysql/

[20:46:43 root @ wangzhike mysql] #https://www.jb51.net:443/article/bin/mysqld--initialize--user = mysql--datadir =/usr/local/mysql/data--字符集服务器= utf8

2020-04-14T12:47:13.718724Z 0 [系统] [MY-013169] [服务器]/usr/local/mysql/bin/mysqld(mysqld 8.0.19)正在初始化服务器,进程9893

2020-04-14T12:47:13.719367Z 0 [警告] [MY-013242] [服务器]--character-set-server:" utf8"当前是字符集UTF8MB3的别名,但将是UTF8MB4的别名在将来的版本中。为了明确起见,请考虑使用UTF8MB4。

2020-04-14T12:47:14.855541Z 5 [Note] [MY-010454] [Server]为root @ localhost生成一个临时密码:rUG-.8kdw \ lt; 1楼

####生成mysql系统数据库。

3.修改配置文件

mysql 8.0.x默认没有配置文件,我们自己创建一个。

[20:49:41 root @ wangzhike mysql] #vi/usr/local/mysql/my.cnf

添加以下内容:

[客户]

端口= 3306

套接字=/tmp/mysql.sock

[mysqld]

端口= 3306

用户= MySQL

套接字=/tmp/mysql.sock

tmpdir =/tmp

key_buffer_size = 16M

max_allowed_packet = 128M

default_authentication_plugin = mysql_native_password

open_files_limit = 60000

explicit_defaults_for_timestamp

服务器ID = 1

字符集服务器= utf8

联盟的

max_connections = 1000

max_connect_errors = 100000

Interactive_timeout = 86400

wait_timeout = 86400

sync_binlog = 0

back_log = 100

默认存储引擎= InnoDB

log_slave_updates = 1

[mysqldump]

[客户]

密码=" 123456"

[mysqld-8.0]

sql_mode =传统

[mysqladmin]

[mysqld]

key_buffer_size = 16M

服务mysqld重新启动

:wq!保存并退出

注意,必须编写语句service mysqld restart,默认密码为123456

其他操作

[20:53:05 root @ wangzhike mysql] #ln-s/usr/local/mysql/my.cnf/etc/my.cnf

#将软链接添加到/etc目录

[20:53:12 root @ wangzhike mysql] #cd

[20:53:13 root @ wangzhike] #cp/usr/local/mysql/support-files/mysql.server/etc/rc.d/init.d/mysqld

#将Mysql添加到系统启动

[20:53:21 root @ wangzhike] #chmod 755/etc/init.d/mysqld

#添加执行权限

[20:53:28 root @ wangzhike] #chkconfig mysqld on

#添加启动启动

4.编辑文件

[20:53:39 root @ wangzhike] #vi/etc/rc.d/init.d/mysqld

####查找basedir =并修改为/usr/local/mysql

####查找datadir =并修改为/data/mysql

basedir =/usr/local/mysql #MySQL程序安装路径

datadir =/数据/mysql #MySQl数据库存储目录

5.成功启动

[20:54:32 root @ wangzhike] #service mysqld start

启动MySQL。登录到"/data/mysql/wangzhike.err"。

。成功! #成功启动

6.添加变量

[20:54:44 root @ wangzhike] #vi/etc/profile

在最后一行添加export PATH = $ PATH:/usr/local/mysql/bin

[20:55:37 root @ wangzhike] #source/etc/profile#使配置立即生效

7.添加软链接

[20:55:44 root @ wangzhike] #ln-s/usr/local/mysql/lib/mysql/usr/lib/mysql

[20:55:57 root @ wangzhike] #ln-s/usr/local/mysql/include/mysql/usr/include/mysql

####上面是将myslq库文件链接到系统默认位置

[20:56:02 root @ wangzhike]#mkdir/var/lib/mysql

[20:56:14 root @ wangzhike] #ln-s/tmp/mysql.sock/var/lib/mysql/mysql.sock

8.启动mysql

[21:40:14 root @ wangzhike] #mysql-uroot-p123456

欢迎使用MySQL监视器。命令以;结尾;或\\\\ g。

您的MySQL连接ID为9

服务器版本:8.0.19源分发

版权所有(c)2000、2020,Oracle和/或其分支机构。版权所有。

Oracle是Oracle Corporation和/或其子公司的注册商标。

会员。其他名称可能是其各自的商标

拥有者。

键入"帮助;"或" \\\\ h"寻求帮助。键入" \\\\ c"以清除当前输入语句。

mysql \ gt;

表示登录成功。

摘要

此处介绍有关在CentOS8部署LNMP环境中mysql-8.0.29的编译和安装的本文。文章或继续浏览下面的相关文章,希望以后每个人都支持该脚本!

您可能感兴趣的文章:

  • CentOS8安装jdk8/java8的教程(推荐)
  • centos8安装图(超级详细的教程)
  • 安装Centos8系统的VMware教程(中文图形模式)
  • 安装Centos8系统的VMware教程(命令行模式)
  • centos8如何使用yum安装mongodb 4.2

未经允许不得转载:数据库同步软件|Mysql数据同步软件|sqlserver数据库同步工具|异构同步 » CentOS8部署LNMP环境之编译安装mysql8.0.29的教程详解

分享到:更多 ()

syncnavigator 8.6.2 企业版

联系我们联系我们