当前位置:网站首页>mysql 5.1升级到5.67

mysql 5.1升级到5.67

2022-04-23 14:06:00 franket

升级新版本mysql

其实就是替换成新版本的软件

因为有依赖关系所以要使用 --nodeps 来忽略掉依赖

[root@upgrade-slave src]# rpm -e Percona-Server-client-51-5.1.73-rel14.12.624.rhel6.x86_64 Percona-Server-server-51-5.1.73-rel14.12.624.rhel6.x86_64 Percona-Server-shared-51-5.1.73-rel14.12.624.rhel6.x86_64 
error: Failed dependencies:
	libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64
	libmysqlclient.so.16()(64bit) is needed by (installed) perl-DBD-MySQL-4.013-3.el6.x86_64
	libmysqlclient.so.16()(64bit) is needed by (installed) php-mysql-5.3.3-46.el6_6.x86_64
	libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64
	libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) perl-DBD-MySQL-4.013-3.el6.x86_64
	libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) php-mysql-5.3.3-46.el6_6.x86_64
	libmysqlclient_r.so.16()(64bit) is needed by (installed) sysbench-0.5-6.el6.x86_64
	libmysqlclient_r.so.16(libmysqlclient_16)(64bit) is needed by (installed) sysbench-0.5-6.el6.x86_64
	mysql-libs is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64
[root@upgrade-slave src]# rpm -e Percona-Server-client-51-5.1.73-rel14.12.624.rhel6.x86_64 Percona-Server-server-51-5.1.73-rel14.12.624.rhel6.x86_64 Percona-Server-shared-51-5.1.73-rel14.12.624.rhel6.x86_64  --nodeps
[root@upgrade-slave src]# ll | grep 56
-rw-r--r--. 1 root   root    6726712 Nov  3 19:31 Percona-Server-client-56-5.6.27-rel75.0.el6.x86_64.rpm
-rw-r--r--. 1 root   root    6566688 Jul 31  2014 Percona-Server-devel-51-5.1.73-rel14.12.624.rhel6.x86_64.rpm
-rw-r--r--. 1 root   root    1032200 Nov  3 19:31 Percona-Server-devel-56-5.6.27-rel75.0.el6.x86_64.rpm
-rw-r--r--. 1 root   root   20480132 Nov  3 19:31 Percona-Server-server-56-5.6.27-rel75.0.el6.x86_64.rpm
-rw-r--r--. 1 root   root     742712 Nov  3 19:31 Percona-Server-shared-56-5.6.27-rel75.0.el6.x86_64.rpm
[root@upgrade-slave src]# rpm -ivh  Percona-Server-client-56-5.6.27-rel75.0.el6.x86_64.rpm  Percona-Server-server-56-5.6.27-rel75.0.el6.x86_64.rpm Percona-Server-shared-56-5.6.27-rel75.0.el6.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:Percona-Server-shared-5########################################### [ 33%]
   2:Percona-Server-client-5########################################### [ 67%]
   3:Percona-Server-server-5########################################### [100%]
Percona Server is distributed with several useful UDF (User Defined Function) from Percona Toolkit.
Run the following commands to create these functions:
mysql -e "CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so'"
mysql -e "CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so'"
mysql -e "CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so'"
See http://www.percona.com/doc/percona-server/5.6/management/udf_percona_toolkit.html for more details
[root@upgrade-slave src]# echo $?
0
[root@upgrade-slave src]# 

尝试启动数据库

[root@upgrade-slave mysql]# /etc/init.d/mysql  start 
Starting MySQL (Percona Server)............The server quit [FAILED]updating PID file (/var/lib/mysql/upgrade-slave.pid).
[root@upgrade-slave mysql]# 

/var/lib/mysql/upgrade-slave.err 日志报错

151126 21:27:16 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2015-11-26 21:27:16 0 [Warning] 'THREAD_CONCURRENCY' is deprecated and will be removed in a future release.
2015-11-26 21:27:16 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-11-26 21:27:16 0 [Note] /usr/sbin/mysqld (mysqld 5.6.27-75.0-log) starting as process 12493 ...
2015-11-26 21:27:16 12493 [Warning] Using unique option prefix myisam_recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
2015-11-26 21:27:16 12493 [Warning] option 'innodb-autoextend-increment': unsigned value 33554432 adjusted to 1000
2015-11-26 21:27:16 12493 [Note] Plugin 'FEDERATED' is disabled.
2015-11-26 21:27:16 7f6ec219f7e0 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2015-11-26 21:27:16 12493 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-11-26 21:27:16 12493 [Note] InnoDB: The InnoDB memory heap is disabled
2015-11-26 21:27:16 12493 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-11-26 21:27:16 12493 [Note] InnoDB: Memory barrier is not used
2015-11-26 21:27:16 12493 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-11-26 21:27:16 12493 [Note] InnoDB: Using Linux native AIO
2015-11-26 21:27:16 12493 [Note] InnoDB: Using CPU crc32 instructions
2015-11-26 21:27:16 12493 [Note] InnoDB: Initializing buffer pool, size = 20.0G
2015-11-26 21:27:21 12493 [Note] InnoDB: Completed initialization of buffer pool
2015-11-26 21:27:22 12493 [Note] InnoDB: Highest supported file format is Barracuda.
2015-11-26 21:27:24 12493 [Note] InnoDB: 128 rollback segment(s) are active.
2015-11-26 21:27:24 12493 [Note] InnoDB: Creating tablespace and datafile system tables.
2015-11-26 21:27:24 12493 [Note] InnoDB: Tablespace and datafile system tables created.
2015-11-26 21:27:24 12493 [Note] InnoDB: Waiting for purge to start
2015-11-26 21:27:24 12493 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.27-75.0 started; log sequence number 4538181520918
2015-11-26 21:27:24 12493 [ERROR] /usr/sbin/mysqld: unknown variable 'table_cache=2048'
2015-11-26 21:27:24 12493 [ERROR] Aborting

2015-11-26 21:27:24 12493 [Note] Binlog end
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'partition'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'ARCHIVE'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'BLACKHOLE'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_CHANGED_PAGES'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_METRICS'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_CMPMEM'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_CMP'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_LOCKS'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'INNODB_TRX'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'XTRADB_RSEG'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'XTRADB_INTERNAL_HASH_TABLES'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'XTRADB_READ_VIEW'
2015-11-26 21:27:24 12493 [Note] Shutting down plugin 'InnoDB'
2015-11-26 21:27:24 12493 [Note] InnoDB: FTS optimize thread exiting.
2015-11-26 21:27:24 12493 [Note] InnoDB: Starting shutdown...
2015-11-26 21:27:27 12493 [Note] InnoDB: Shutdown completed; log sequence number 4538183224168
2015-11-26 21:27:27 12493 [Note] Shutting down plugin 'CSV'
2015-11-26 21:27:27 12493 [Note] Shutting down plugin 'MyISAM'
2015-11-26 21:27:27 12493 [Note] Shutting down plugin 'MRG_MYISAM'
2015-11-26 21:27:27 12493 [Note] Shutting down plugin 'MEMORY'
2015-11-26 21:27:27 12493 [Note] Shutting down plugin 'sha256_password'
2015-11-26 21:27:27 12493 [Note] Shutting down plugin 'mysql_old_password'
2015-11-26 21:27:27 12493 [Note] Shutting down plugin 'mysql_native_password'
2015-11-26 21:27:27 12493 [Note] Shutting down plugin 'binlog'
2015-11-26 21:27:27 12493 [Note] /usr/sbin/mysqld: Shutdown complete

151126 21:27:27 mysqld_safe mysqld from pid file /var/lib/mysql/upgrade-slave.pid ended

原因为某些参数在新的版本里已经不被支持,或者将要被废弃,或者已经改成了新的名字,解决方法是查阅文档,修改配置文件

版权声明
本文为[franket]所创,转载请带上原文链接,感谢
https://cloud.tencent.com/developer/article/1986102