小樱 发表于 2020/4/23 05:49

Linux发行版centos 6升级kangle默认的mysql5.6为mysql5.7版本的详细一键脚本教程,构造大概升级请酌情考虑

升级后无法新建mysql用户提示,请注意执行修复
#3009 - Column count of mysql.user is wrong. Expected 45, found 43. Created with MySQL 50647, now running 50729. Please use mysql_upgrade to fix this error.

请看此帖解决方案
https://bbs.itzmx.com/thread-95487-1-1.html

本帖教程对应环境为centos6.10测试

某些该死的程序可能要5.7的mysql数据库,比如说FlarumChina,但是mysql构造大改,,很多程序又不支持5.7,所以用作空间销售等升级到5.7是不推荐不适合的。


注意,本方法为全新安装环境后立即升级,不保留任何数据库,会丢失数据,请不要在已经运行网站的情况下使用。
yum -y remove mysql mysql*
rm -rf /var/lib/mysql/*
yum -y install mysql-libs
rpm -ivh http://github.itzmx.com/1265578519/repo/master/CentOS/5.7/mysql57-community-release-el6-7.noarch.rpm
rm -rf /etc/yum.repos.d/mysql-community.repo /etc/yum.repos.d/mysql-community-source.repo
wget http://github.itzmx.com/1265578519/repo/master/CentOS/5.7/mysql-community.repo -O /etc/yum.repos.d/mysql-community.repo
yum -y install mysql mysql-server
yum -y install php-cli php-mysqlphp-gd php-xml php-ldap php-mbstring php-bcmath php-pdo
service mysqld restart
chkconfig --level 2345 mysqld on
rm -rf /etc/my.cnf
wget http://github.itzmx.com/1265578519/kangle/master/mysql/5.7/my.cnf -O /etc/my.cnf
service mysqld restart

根据这个贴,手动设置一次新密码(如果已经安装5.6并且初始化则不需要重新设置新密码,原有的密码就可以登录啦,但是已经3312初始化在进行5.7安装的话,会导致无法建立新的用户数据库,参考顶部解决方案)
https://bbs.itzmx.com/thread-95491-1-1.html

升级完毕后登陆ip:3312/admin后台,新建用户网站后,使用root账号登陆数据库管理,观察用户是否成功新建,若未成功建立,请看帖子顶部标红处解决方法

5.7优化/etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html


#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
innodb_buffer_pool_size = 8M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
join_buffer_size = 8M
sort_buffer_size = 2M
read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
server-id = 1
log-bin
max_binlog_size=50M
expire_logs_days=7
skip-networking
default-time-zone = '+8:00'
performance_schema_max_table_instances=200
table_definition_cache=200
table_open_cache=128

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

注:5.6的和5.7的my.cnf不通用,开启log-bin一定要设置server-id,my.cnf优化启动内存到117MB(https://bbs.itzmx.com/thread-95490-1-1.html)


如需转载,请注明出处:IT技术交流论坛

不可名 发表于 2020/4/23 05:57

太长看不懂

phrnet 发表于 2020/7/21 15:49

支持 期待好久了

chungbin 发表于 2024/5/11 11:11

新建网站不会自动创建数据库

chungbin 发表于 2024/5/11 11:22

手动创建完数据库后在mysql库你的user表复制插入提示
#1364 - Field 'ssl_cipher' doesn't have a default value
页: [1]
查看完整版本: Linux发行版centos 6升级kangle默认的mysql5.6为mysql5.7版本的详细一键脚本教程,构造大概升级请酌情考虑