首页 > 数据库 >编译安装MySQL8及常见错误处理

编译安装MySQL8及常见错误处理

时间:2023-07-11 14:00:32浏览次数:39  
标签:tmp gcc MySQL8 编译 file mysql home 错误处理 txt

初稿。。。

1.下载

https://downloads.mysql.com/archives/community/

选择对应版本->选择 source code ->系统版本一定要选all ->拉至最下方-选择mysql-boost-8.0.xx.tar.gz(不下载带有boost的压缩包,需自行安装boost)

图片后续添加。

 2.解压

tar -zxf mysql-boost-8.0.25.tar.gz

3.编译安装

#预编译
cmake3 -DCMAKE_INSTALL_PREFIX=/home/apps/mysql  -DMYSQL_UNIX_ADDR=/home/apps/mysql.sock   -DEXTRA_CHARSETS=all  -DDEFAULT_CHARSET=utf8  -DDEFAULT_COLLATION=utf8_general_ci  -DWITH_MYISAM_STORAGE_ENGINE=1  -DWITH_INNOBASE_STORAGE_ENGINE=1  -DWITH_MEMORY_STORAGE_ENGINE=1  -DWITH_READLINE=1  -DENABLED_LOCAL_INFILE=1  -DCMAKE_C_COMPILER=/home/apps/gcc/bin/gcc -DCMAKE_CXX_COMPILER=/home/apps/gcc/bin/g++   -DFORCE_INSOURCE_BUILD=1  -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/home/downloads/mysql/mysql-8.0.25/boost -DMYSQL_USER=mysql  -DMYSQL_TCP_PORT=3306 

#编译
make

#安装
make install

4.初始化

#配置文件/etc/my.cnf

[mysqld]
datadir=/home/data
socket=/home/apps/mysql/mysql.sock
bind-address=0.0.0.0(可根据情况修改为本机IP)
port=3306

#创建用户
useradd -s /sbin/nologin -M mysql

#初始化
cd /home/apps/mysql/bin/ ./mysqld --initialize --user=mysql --basedir=/home/apps/mysql --datadir=/home/data

#启动登录并更新密码
./mysqld_safe --user=mysql
mysql -u root -p -h 127.0.0.1 -P 3306

use mysql;
select user,host from mysql;
alter user 'root'@'localhost' identified by '123456';
#添加远程登录
create user 'root'@'%' identified by '123456';
grant all privileges on *.* to 'root'@'%' with grant option;
flush privileges;

 

 

 

 

 二、常见错误

1.Please install the appropriate openssl developer package

Cannot find appropriate system libraries for WITH_SSL=system.
Make sure you have specified a supported SSL version.
Valid options are :
system (use the OS openssl library),
yes (synonym for system),
</path/to/custom/openssl/installation>

CMake Error at cmake/ssl.cmake:61 (MESSAGE):
  Please install the appropriate openssl developer package.

Call Stack (most recent call first):
  cmake/ssl.cmake:315 (FATAL_SSL_NOT_FOUND_ERROR)
  CMakeLists.txt:1344 (MYSQL_CHECK_SSL)


-- Configuring incomplete, errors occurred!
See also "/home/downloads/mysql/mysql-8.0.25/CMakeFiles/CMakeOutput.log".
See also "/home/downloads/mysql/mysql-8.0.25/CMakeFiles/CMakeError.log".

解决方案

yum install openssl-devel

2.libisl.so.15 no such file or directory

解决方案

/etc/ld.so.conf 添加如下内容
include ld.so.conf.d/*.conf
/usr/local/lib

/usr/local/lib 为libisl.so.15所在目录

文件内容添加后,执行ldconfig

查看当前动态库
ldconfig -p

3./lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found

../runtime_output_directory/uca9dump: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ../runtime_output_directory/uca9dump)
make[2]: *** [strings/uca900_zh_tbls.cc] Error 1
make[1]: *** [strings/CMakeFiles/strings_objlib.dir/all] Error 2
make: *** [all] Error 2

解决方案

gcc升级时,新版本动态库未覆盖旧版本动态库
删除旧软连接。生成新链接

find / -name libstdc++.so.6
rm /usr/lib/libstdc++.so.6 /usr/lib64/libstdc++.so.6
ln -s /home/apps/gcc/lib64/libstdc++.so.6  /usr/lib64/libstdc++.so.6
ln -s /home/apps/gcc/lib64/libstdc++.so.6 /usr/lib/libstdc++.so.6

4.error: ‘SYS_gettid’ was not declared in this scope

In function ‘void buf_pool_create(buf_pool_t*, ulint, ulint, std::mutex*, dberr_t&)’:
/home/downloads/mysql/mysql-8.0.25/storage/innobase/buf/buf0buf.cc:1228:44: error: ‘SYS_gettid’ was not declared in this scope

解决方案

在文件buf0buf.cc的开头添加: 
#include "sys/syscall.h" 再次make

5.gcc版本过低

解决方案

升级gcc
gcc下载地址
http://www.netgull.com/gcc/releases/gcc-9.3.0


依赖包下载地址
ftp://gcc.gnu.org/pub/gcc/infrastructure/

gmp-6.1.0.tar.bz2
isl-0.18.tar.bz2
mpfr-3.1.4.tar.bz2
mpc-1.0.3.tar.gz

./configure make && make install tar -zxf gcc-9.3.0.tar.gz && cd gcc-9.3.0 ./configure --prefix=/home/apps/gcc --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --disable-multilib make make install

 解压文件脚本

#!/bin/bash

COM_DIR=$1
DECOM_DIR=$2

get_file(){
    ls $COM_DIR>>/tmp/filelist.txt
    FILELIST=/tmp/filelist.txt
    n=1
    j=`(wc -l $FILELIST|awk '{print $1}')`
    cat $FILELIST |awk -F'.' '{print $NF}'|while read i
    do
        if [ $i = gz ];then
            if [ $n -le $j ];then
                sed -n "$n"p $FILELIST >>/tmp/gz_file.txt
                n=$(($n + 1))
            fi
        elif [ $i = bz2 ];then
            if [ $n -le $j ];then
                 sed -n "$n"p $FILELIST >>/tmp/bz2_file.txt
                 n=$(($n + 1))
            fi
        else
            if [ $n -le $j ];then
                 sed -n "$n"p $FILELIST >>/tmp/other_file.txt
                 n=$(($n + 1))
            fi
        fi
    done
}

decom_gz(){
    cat /tmp/gz_file.txt|while read i
    do
        tar -zxf $COM_DIR/$i -C $DECOM_DIR  &>/dev/null
        if [ $? -eq 0 ];then
            echo "$i decom successed."
        else
            echo "$i decom failed."
        fi
    done
}

decom_bz2(){
    cat /tmp/bz2_file.txt|while read i
    do
        tar -jxf $COM_DIR/$i -C $DECOM_DIR  &>/dev/null
        if [ $? -eq 0 ];then
            echo "$i decom successed."
        else
            echo "$i decom failed."
        fi
    done
}



del_tmp_file(){
    rm /tmp/filelist.txt /tmp/other_file.txt /tmp/bz2_file.txt /tmp/gz_file.txt -f

}

if [ -z $1 -o -z $2 ];then
    echo "Please enter the compressed file directory and decompression directory"
    echo "eg: ./decom.sh /tmp/gcc /home/apps/gcc "
else
    get_file
    decom_bz2
    decom_gz
    del_tmp_file
fi

 

标签:tmp,gcc,MySQL8,编译,file,mysql,home,错误处理,txt
From: https://www.cnblogs.com/sswind/p/17542949.html

相关文章

  • maven编译平台不同导致编译结果不兼容的问题(windows|linux)intel daal
    1.依赖有依赖如下<dependency><groupId>com.intel.daal</groupId><artifactId>daal</artifactId><version>2019.3.199</version></dependency>2.依赖路径依赖com.intel.daal.daal->com.intel.daal.daal-parent......
  • CMakeLists编译静态库与动态库
    一、编写一个库编写一个计算整数和浮点数之和的库函数mymath,文件目录 mymath.h#ifndefMYMATH_H#defineMYMATH_H intadd(int,int);doubleadd(double,double); #endifmymath.cc#include"mymath.h" intadd(inta,intb){  returna+b;} doubleadd(doublea,d......
  • Cmake交叉编译编译动态库
    cmakelists.txt写法如下 编译指令:cmake-DCMAKE_CXX_COMPILER:FILEPATH=/home/wangwc/CompilerCollection/RuiXinWei/prebuilts/gcc/linux-x86/arm/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++… aux_source_directory:遍历./ITA_LIB目......
  • mysql8.0多实例部署,同版本多实例和不同版本实例
    一、配置Mysql8.0同版本多实例1、解压移动安装位置2、创建Mysql管理组和用户3、创建多实例用户数据库存储目录修改目录所有者4、修改多实例Mysql主配置文件5、初始化多实例Mysql6、启动服务7、登录多实例Mysql二、配置Mysql不同版本多实例1、安装Mysql5.62、修改mysql5.6主配置文件......
  • Ubuntu12.04 交叉编译 opencv-2.4.11过程
    1.Ubuntu换源可换源有很多,不过要下载12.04版的,好像不多。1.1先备份源sudocp/etc/apt/sources.list/etc/apt/sources.list.backup1.2由于12.04不受支持了,12.04相关的这些包的资源被移到了old-releases.ubuntu.com域名下:sudogedit/etc/apt/sources.list将下面内容插入......
  • springcloud -sentinel 用户自定义限流错误处理(仅限限流异常,其他异常请使用fallback属
    pom依赖<!--SpringCloudailibabanacos--><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId></dependency>......
  • Selenium基础:SSL证书错误处理 13
    1、chrome解决办法在chromeoptions()中添加”--ignore-certificate-errors"为true的选项#-*-coding:utf-8-*-fromseleniumimportwebdriveroptions=webdriver.ChromeOptions()#添加忽视证书错误选项options.add_argument('--ignore-certificate-errors')driver=web......
  • apollo+carsim自动驾驶控制模块仿真 windows联系独编译,
    apollo+carsim自动驾驶控制模块仿真windows联系独编译,和carsim联合仿真仿真调试有编译和调试过程文档基于windows平台,所有依赖的库有预编译好的包apollo6.0版本。ID:6699625478961058......
  • Go优雅的错误处理: 支持错误堆栈, 错误码, 错误链的工具库
    地址:https://github.com/morrisxyang/errors如果觉得有用欢迎Star和PR,有问题请直接提issueerrors简单的支持错误堆栈,错误码,错误链的工具库:支持携带堆栈,嵌套构造错误链支持携带错误码,方便接口返回支持自定义堆栈打印深度和错误链打印格式使用......
  • MyEclipse 10 配置jad反编译工具步骤及详解
    MyEclipse10如何查看底层源码可以配置jad//下面是步骤:方法一1、下载jad158g.win.zip文件和net.sf.jadclipse_3.3.0.jar文件。2、将下载的jad158g.win.zip文件解压,并将jad.exe文件复制到jdk的安装目录下的jre文件夹下。例如:D:\develop\Java\jre7\bin\jad.exe。3、将下载的net......