Mysql5升级到Mysql5.5的方法_MySQL
安装5.5依赖安装包
代码如下
yum install -y autoconf* automake* zlib* libxml* ncurses-devel* libgcrypt* libtool* openssl*
安装cmake
代码如下
yum install -y cmake
在升级前,建议先将之前5.1的mysql及数据库目录备份一下
停止掉mysql
代码如下
service mysql stop
升级mysql 5.5.36
代码如下
http://download.csdn.net/download/cike121272604/6943279 tar xf mysql-5.5.36.tar.gz cd mysql-5.5.36 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc -DMYSQL_DATADIR=/usr/local/mysql/var -DMYSQL_TCP_PORT=3306 -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DMYSQL_USER=mysql -DEXTRA_CHARSETS=all -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 make && make install
删除/etc/下的my.cnf配置文件
代码如下
rm -rf /etc/my.cnf
拷贝5.5的配置文件
代码如下
cp support-files/my-huge.cnf /etc/my.cnf
尝试启动一下
代码如下
service mysql start
执行更新程序并重启mysql
代码如下
/usr/local/mysql/bin/mysql_upgrade
如果一路OK就没事儿,但要是出了错误,请参考我另外一篇文章 mysql5.5升级过程中mysql_upgrade失败的问题
查看下现在的mysql版本
代码如下
cat mysql_upgrade_info
好了,升级工作完成。
再附升级失败问题解决
在升级mysql5.5过程中,执行/usr/local/mysql/bin/mysql_upgrade
提示:
代码如下
Looking for 'mysql' in: /usr/local/mysql/bin/mysql Looking for 'mysqlcheck' in: /usr/local/mysql/bin/mysqlcheck Running 'mysqlcheck'... /usr/local/mysql/bin/mysqlcheck: Got error: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOR UPGRADE' at line 1 when executing 'CHECK TABLE ... FOR UPGRADE' FATAL ERROR: Upgrade failed
想起之前5.1好像是有密码的!这儿换种方式尝试
代码如下
/usr/local/mysql/bin/mysql_upgrade -S /var/data/mysql.sock -uroot -p
这个也不行了,突然想到出奇招,还是使用5.5的二进制程序,然后更改启动参数,因为我只想要把data目录下的表结构升级而已,必须指定的参数只是data目录,于是我做了如下尝试
# 启用 --skip-grant-tables参数避开检查,先启动再说
代码如下
/usr/local/mysql/bin/mysqld --datadir=/usr/local/mysql/var/ --user=mysql --skip-grant-tables &
# 看上去成功了
# 中间报了一些innodb的错误,不去理会,应该是配置或是这个半阴半阳状态下问题,这个以后再解决
# 接下来停止这个服务 mysqladmin shutdown 之,然后以正常参数启动mysqld服务…… 修改些my.cnf中的配置参数,以适合mysql5.5
一句话总结:
代码如下
/usr/local/mysql/bin/mysqld --datadir=/usr/local/mysql/var/ --user=mysql --skip-grant-tables &
以上就是Mysql5升级到Mysql5.5的方法_MySQL的内容,更多相关内容请关注PHP中文网(www.php.cn)!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

InnoDB's full-text search capabilities are very powerful, which can significantly improve database query efficiency and ability to process large amounts of text data. 1) InnoDB implements full-text search through inverted indexing, supporting basic and advanced search queries. 2) Use MATCH and AGAINST keywords to search, support Boolean mode and phrase search. 3) Optimization methods include using word segmentation technology, periodic rebuilding of indexes and adjusting cache size to improve performance and accuracy.
