源码安装mysql升级_mysql源码编译升级

https://www.cnblogs.com/centos-python/articles/10860421.html

https://www.cnblogs.com/galengao/p/5755788.html

https://www.it610.com/article/1295827323290984448.htm

cmake升级 hash -r

gcc升级

mysqld与mysqld_save的区别

h+fGoYIum8jAwAAAABJRU5ErkJggg==

下载的源码包 mysql-8.0.16.tar.gz

编译安装mysql-8.0.16 遇到的问题和解决方案:

一:CMake 3.4.3 or higher is required. You are running version 2.8.12.2

要求安装cmake3这个包

需要安装扩展包,cmake3 在扩展库里面

yum install epel-release -y

yum install cmake3 -y

二:Please do not build in-source. Out-of source builds are highly

1.在mysql源码根目录下新建build:mkdir -p build

2.切换build目录:cd build/

3.将cmake3. 换成 cmake3.. 执行编译命令即可,不再报错

三:GCC 5.3 or newer is required (-dumpversion says 4.8.5)

升级GCC 要求 >5.3

yum groupinstall "Development Tools" yum install glibc-static libstdc++-static(这两个是必要的开发环境) ../configure --prefix=/usr/local/gcc9 --enable-languages=c,c++,go --disable-multilib // 指定gcc9安裝地址,

# ln -s /usr/local/gcc/bin/gcc /usr/bin/gcc

# ln -s /usr/local/gcc/bin/c++ /usr/bin/c++

# ln -s /usr/local/gcc/bin/g++ /usr/bin/g++

# ln -s /usr/local/gcc/lib64/libstdc++.so.6.0.22 /usr/lib64/libstdc++.so.6

mysql添加用户并放开权限

mysql>CREATEUSER'finley'@'localhost'IDENTIFIEDBY'some_pass';

mysql>GRANT ALL PRIVILEGESON*.*TO'finley'@'localhost'WITHGRANT OPTION;

mysqladmin -u用户名 -p旧密码 password 新密码

/usr/local/mysql/bin/mysqld --initialize-insecure --user=root --basedir=/usr/local/mysql --datadir=/config/mysql/data

数据库错误统计:

ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (youmightwant to use the less safe log_bin_trust_function_creators variable)

在my.cnf里面设置

log-bin-trust-function-creators=1

mysql: [Warning] Using a password on the command line interfacecan be insecure.

ERROR3678 (HY000) at line 1: Schema directory './zabbix' already exists. This must be resolved manually (e.g. by moving the schema directory to another location).

[root@localhost mysql]# rm -rf zabbix/=================================================

select @@GLOBAL.sql_mode

1.开启与关闭Strict Mode方法

找到MySQL安装目录下的my.cnf(windows系统则是my.ini)文件

在sql_mode中加入STRICT_TRANS_TABLES则表示开启严格模式,如没有加入则表示非严格模式,修改后重启mysql即可

例如这就表示开启了严格模式:

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

=======================================================

SHOWVARIABLESWHEREVariable_nameLIKE'character_set_%'ORVariable_nameLIKE'collation%';

[mysqld]

character-set-server=utf8mb4

[mysql] default-character-set=utf8mb4

[client] default-character-set=utf8mb4

=========================================================

sed -i "s/oldstring/newstring/g" `grep oldstring -rl yourdir`

=============================================

https://downloads.mysql.com/archives/c-c/?version=6.1.2&os=src

libmysql的C语言库下载

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值