本教程对应环境为centos6.5测试
是否为了这该死的mysql5.1性能差而烦恼?是否因为官方不提供升级不上mysql5.6而抱怨。来吧,本帖完美教程,绝不丢任何数据,虚拟机环境多次测试,简单快捷,让你的mysql性能提升十五倍,疯狂吧,欢呼吧,少年。内存已经优化占用到70M左右。rpm -ivh httpss://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community-release-el6-5.noarch.rpm
rm -rf /etc/yum.repos.d/mysql-community.repo
rm -rf /etc/yum.repos.d/mysql-community-source.repo
wget httpss://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community.repo -O /etc/yum.repos.d/mysql-community.repo
wget httpss://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community-source.repo -O /etc/yum.repos.d/mysql-community-source.repo
yum -y update
yum -y install mysql mysql-server
rm -rf /var/lib/mysql/ibdata1
rm -rf /var/lib/mysql/ib_logfile0
rm -rf /var/lib/mysql/ib_logfile1
service mysqld restart
chkconfig --level 2345 mysqld on
注:vhms采用InnoDB类型方式,上述代码中会删除ibdata1文件,请注意检查(现在的PHP程序都不会采用InnoDB,如果未安装vhms请放心,不过还是建议先备份,方便误删后还原,QAQ楼主悲剧了,掉了一个半月数据库,特来做个提醒,或者你有更好的方法不用删除ibdata1文件,欢迎留言指出,谢谢各位。)。
最后请修改/etc/my.cnf为mysql5.6的版本,如果升级还是以前5.1的,不通用,可能会导致一些未知问题官方文档:httpss://dev.mysql.com/doc/refman/ ... efault-changes.htmlvi /etc/my.cnf# For advice on how to change settings please see
# httpss://dev.mysql.com/doc/refman/ ... ation-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
log-bin
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
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
如果不会VI命令,可以利用FLASHFXP等SFTP软件,把文件下载到windows本地修改,然后上传回去即可。改好后重启下mysql或者reboot重启机器即可。InnoDB备份的SQL恢复提示报错文件已存在怎么办?答:可以利用FLASHFXP等软件使用SFTP模式进入/var/lib/mysql/,删除导入提示重复的对应的frm后缀文件。
以上来源:IT技术交流论坛 博主亲测有效 如果出现
已知BUG无法新建mysql用户数据库会提示#2013 - lost connection to mysql server during query错误信息(已解决)
1.增加配置项,重启vi /etc/my.cnf
[mysqld]performance_schema=onservice mysqld restart
2.SSH运行命令升级mysql_upgrade -uroot -p数据库密码
MySQL使用yum升级后无法开机启动的解决方法
linux下mysql无法启动的解决方法