mysql5.1升级5.6步骤以及出现问题解决方法

1、先看看有没有老的mysql

rpm -qa |grep -i mysql

有条目出现,删除 mysql5.1 yum remove mysql*

2、安装rpm包

rpm -ivh mysql*.rpm

3、拷贝配置文件

cp /usr/share/mysql/my-defautl.cnf /etc/my.cnf

4、运行 /usr/bin/mysql-install-db

出现如下问题

[ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 640 pages (rounded down to MB) than specified in the .cnf file: initial 1280 pages, max 0 (relevant if non-zero) pages!
2016-08-24 09:47:50 28969 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
 [ERROR] Plugin 'InnoDB' init function returned error.
 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
 [ERROR] Unknown/unsupported storage engine: InnoDB
 [ERROR] Aborting

解决: cd /var/lib/mysql 删除 ibdata1 ib_logfile1 ib_logfile0

重启/usr/bin/mysql-install-db

5、mysql-install-db过程中会出现一些向导操作,可以按提示操作

启动sql服务 service mysql start

出现如下问题:

 ERROR! The server quit without updating PID file (/var/lib/mysql/iZ23ilvy6csZ.pid).

解决:给ibdata1文件写权限 chmod 777 ibdata1

6、mysqladmin -u root password 'newpassword'

出现Access denied for user 'root'@'localhost' (using password: NO)说明密码已经设置

解决:在my.cnf 后面追加一条skip_grant_tables

用无密码方式进入 >mysql use mysql; update user set password=password('new password') where user='root';flush privileges;

期间出现

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

解决:chown -R mysql:mysql /var/lib/mysql 改变权限就可以了

退出重启mysql

修改my.cnf注释 skip-grant-tables

Error: could not open single-table tablespace file ./mysql/slave_worker_info.ibd

解决:my.cnf 加一条 innodb_force_recovery=1

7、允许远程登陆

修改mysql表 在user表添加记录

8、设置开机启动

chkconfig mysql on

查看 chkconfig --list |grep mysql

9、mysql默认路径

/var/lib/mysql

/usr/share/mysql /usr/bin

/etc/init.d/mysql


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要将MySQL 5.1的数据迁移到新的数据库,您可以按照以下步骤进行操作: 1. 确保已经将MySQL数据库升级5.6以上版本,因为Nacos只支持5.6以上的MySQL版本[1]。 2. 备份原始的MySQL 5.1数据库中的所有数据。 3. 创建一个新的MySQL 5.6或更高版本的数据库,并确保该数据库已正确安装和配置。 4. 将备份的数据导入到新的MySQL数据库中。 5. 针对Nacos的要求,在迁移数据之前,请确保将原MySQL安装目录下的data目录中的ibdata1文件覆盖到新的MySQL数据目录中。 6. 启动新的MySQL数据库,并验证数据是否成功导入。 7. 确保您的项目环境已经配置好了Python环境、node.js前端环境和MySQL数据库。 8. 运行您的项目,并确保它可以连接到新的MySQL数据库。 通过按照以上步骤进行操作,您应该能够成功迁移MySQL 5.1的数据至新的数据库。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [Mysql5.5版本数据迁移至5.7版本](https://blog.csdn.net/weixin_57882850/article/details/123518127)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *3* [基于Django+node.js+MySQL+杰卡德相似系数智能新闻推荐系统-机器学习算法应用(含Python源码)+数据集](https://download.csdn.net/download/qq_31136513/88285126)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值