成长值: 336 签到天数: 4737 天
[LV.Master]伴坛终老
发表于 2020/4/23 05:49
|
显示全部楼层
| 阅读模式
| Google Chrome 81.0.4044.122
| Windows 10
升级后无法新建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-mysql php-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
[mysqld]
#
# 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技术交流论坛
评分
查看全部评分