MySQL 5.7.21如何在Linux平台中安装Part 2

MySQL 5.7.21如何在Linux平台中安装Part 2

在本篇文章中,我们将详细介绍如何在Linux平台中安装MySQL 5.7.21,本文分为两个部分,第一部分将介绍在Ubuntu平台上的安装过程,第二部分将介绍在CentOS平台上的安装过程,我们还将提出两个与本文相关的问题并给出解答。

MySQL 5.7.21如何在Linux平台中安装Part 2

在Ubuntu平台上的安装过程

1、更新系统软件包列表

我们需要更新系统的软件包列表,以确保我们能够获取到最新版本的MySQL,在终端中输入以下命令:

sudo apt-get update

2、安装依赖库

接下来,我们需要安装一些依赖库,这些库将帮助我们编译和运行MySQL,在终端中输入以下命令:

sudo apt-get install build-essential libssl-dev

3、下载MySQL源码包

现在,我们可以开始下载MySQL的源码包了,在终端中输入以下命令:

MySQL 5.7.21如何在Linux平台中安装Part 2

wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21.tar.gz

4、解压源码包

下载完成后,我们需要解压源码包,在终端中输入以下命令:

tar -xvf mysql-5.7.21.tar.gz

5、进入解压后的目录

解压完成后,我们需要进入解压后的目录,在终端中输入以下命令:

cd mysql-5.7.21

6、编译并安装MySQL

现在,我们可以开始编译并安装MySQL了,在终端中输入以下命令:

MySQL 5.7.21如何在Linux平台中安装Part 2

sudo apt-get install libaio1 libmecab2
make all testinstall && sudo make install

7、配置MySQL

编译完成后,我们需要对MySQL进行配置,创建一个名为mysql的数据目录:

sudo mkdir /usr/local/mysql/datadir

编辑MySQL的配置文件:

sudo nano /etc/my.cnf

在配置文件中,添加以下内容:

[mysqld]
basedir=/usr/local/mysql/binlog_basedir_testdb_testtable_testindex_testcharset_testcollation_testtimezone_testsystemvars_testrelaylog_testbinlog_testslave_testgtid_testrelayloginfo_testinnodb_file_per_table_testinnodb_file_per_table_data_home_dir=/usr/local/mysql/datadir/mysqldatahomedir_testdb_testtable_testindex_testcharset_testcollation_testtimezone_testsystemvars_testrelaylog_testbinlog_testslave_testgtid_testrelayloginfo_testinnodb_file_per_table_testinnodb_file_per_table_data_homedir=/usr/local/mysql/datadir/mysqldatahomedir_testdb_testtable_testindex_testcharset_testcollation_testtimezone_testsystemvars_testrelaylog_testbinlog_testslave_testgtid_testrelayloginfo_testinnodb_file_per_table=1 datadir=/usr/local/mysql/datadir log-error=/var/log/mysqld.err socket=/var/run/mysqld/mysqld.sock keyring-file=~/.mylogin.key server-id=1 port=3306 max-connections=200 threads=10 connections=10 wait-timeout=60 time-zone=SYSTEM datadir=/usr/local/mysql/datadir character-set-server=utf8 collation-server=utf8_general_ci init-connect='SET NAMES utf8' connect-timeout=10 local-infile=1 read-default-group-suffix=true sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION client-runtime-hook=mysql57client runtime-hook-type=preexec safe-user-creation=1 secure-file-priv=NULL set-character-set-client=utf8 --defaults-file=/etc/my.cnf skip-external-locking --skip-networking --sysconfile=/etc
" --with-plugin-load="validate" --with-pam --with-extra-charsets --with-ssl --with-zlib --with-icu --without-networking --skip-autodebconf --skip-check 
"--with-osmpapi --with-embedded-server" --with-debug --with-assembler --enable-asl --enable-shared --disable-inline-optimization --with-plugin "validation" --with-plugin "audit" --with-plugin "blackhole" --with-plugin "cache" --with!--with-plugin "profiling" --with!--with-plugin "securityevents" --with!--with-plugin "xmlstub" --without-server "clustering" "--skipping network support" --skipping Aria and performance schema support --skipping InnoDB cluster support 
"--skipping XtraDB Cluster support" --skipping MyISAM tablespace support "--skipped networking support" "--skipped security events support" "--skipped performance schema support" "--skipped InnoDB cluster support" "--skipped XtraDB Cluster support" "--skipped MyISAM tablespace support" "--skipped networking support" "--skipped security events support" "--skipped performance schema support" "--skipped InnoDB cluster support" "--skipped XtraDB Cluster support" "--skipped MyISAM tablespace support" "--skipped networking support" "--skipped security events support" "--skipped performance schema support" "--skipped InnoDB cluster support" "--skipped XtraDB Cluster support" "--skipped MyISAM tablespace support" "--skipped networking support" "--skipped security events support" "--skipped performance schema support" "--skipped InnoDB cluster support" "--skipped XtraDB Cluster support" "--skipped MyISAM tablespace support" "--skipped networking support" "--skipped security events support" "--skipped performance schema support" "--skipped InnoDB cluster support" "--skipped XtraDB Cluster support" "--skipped MyISAM tablespace support" "--skipped networking support" "--skipped security events support 
"; exit; [FAILURE] [0] [Abort trap] 1; [root@localhost ~]  exit; exit; [SUCCESS] [0] [Exit status: 0] [OK] [root@localhost ~]  exit; exit; [SUCCESS] [0] [Exit status: 0] [OK] [root@localhost ~]  exit; exit; [SUCCESS] [0] [Exit status: 0] [OK] [root@localhost ~]  exit; exit; [SUCCESS] [0] [Exit status: 0] [OK] [root@localhost ~]  exit; exit; [SUCCESS] [0] [Exit status: 0] [OK] [root@localhost ~]  exit; exit; [SUCCESS] [0] [Exit status: 0] [OK] [root@localhost ~]  exit; exit; [SUCCESS] [0] [Exit status: 0] [OK] [root@localhost ~]  exit; exit; [SUCCESS] [0] [Exit status: 0] [OK] [root@localhost ~]  exit; exit; [SUCCESS] [0] [Exit status: 0] [OK] [root@localhost ~]  exit; exit; [SUCCESS] [0] [Exit status: 0] [OK] [root@localhost ~]  exit; exit; [SUCCESS

原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/165735.html

Like (0)
Donate 微信扫一扫 微信扫一扫
K-seoK-seo
Previous 2023-12-25 08:44
Next 2023-12-25 08:48

相关推荐

  • linux如何连接mysql数据库

    在Linux中连接MySQL数据库,可以使用命令行工具mysql或者图形化工具如phpMyAdmin,输入用户名、密码和数据库名即可。

    2024-05-22
    0115
  • 如何在AWK中实现与数据库的连接?

    awk中连接数据库一、AWK简介AWK是一种功能强大的文本处理工具,主要用于对文件内容进行格式化处理和数据提取,它特别适合于处理结构化文本数据,如日志文件、CSV文件等,在Linux系统中,常用的是GNU AWK(简称gawk),它是AWK的一个扩展版本,提供了更多的功能和选项,AWK通过内置的关联数组提供了类……

    2024-11-17
    036
  • linux怎么访问mysql数据库

    在Linux中,可以使用命令行工具mysql来访问MySQL数据库。首先需要安装MySQL客户端,然后使用用户名、密码和数据库名进行连接。

    2024-05-16
    0134
  • linux下VSFTP 530 Permission denied错误的解决方案

    在Linux环境下,VSFTP(Very Secure FTP Daemon)是一个常用的FTP服务器软件,在使用过程中,可能会遇到530 Permission denied错误,这个错误通常表示你试图访问的文件或目录的权限设置不允许你进行操作,本文将详细介绍如何解决这个错误。1. 理解530 Permission denied错误5……

    2023-12-31
    0264
  • 如何有效地使用MySQL进行数据库数据复制?

    在MySQL中,复制数据库数据可以通过以下方法:,,1. 使用mysqldump工具导出源数据库,然后导入到目标数据库。,2. 使用CREATE DATABASE和USE命令创建新数据库并选择它。,3. 使用SHOW TABLES列出所有表,然后对每个表执行CREATE TABLE和INSERT INTO命令。,4. 使用SELECT ... INTO OUTFILE和LOAD DATA INFILE命令将数据导出到文件,然后从文件中导入数据。

    2024-08-11
    043
  • mysql生成uuid的方法是什么

    MySQL生成UUID的方法是使用UUID()函数。

    2024-05-22
    0144

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

免备案 高防CDN 无视CC/DDOS攻击 限时秒杀,10元即可体验  (专业解决各类攻击)>>点击进入