【MySQL】数据库版本升级:mysql 5.6 升级到 mysql 5.7
16lz
2021-01-22
[root@wallet01 ~]# mysql -uroot -pabcd.1234mysql> select version();+------------+| version() |+------------+| 5.6.50-log |+------------+1 row in set (0.00 sec)mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema || soe |+--------------------+4 rows in set (0.02 sec)mysql> show variables like 'innodb_fast_shutdown';+----------------------+-------+| Variable_name | Value |+----------------------+-------+| innodb_fast_shutdown | 1 |+----------------------+-------+1 row in set (0.00 sec)mysql> set global innodb_fast_shutdown = 0;Query OK, 0 rows affected (0.00 sec)mysql> show variables like 'innodb_fast_shutdown';+----------------------+-------+| Variable_name | Value |+----------------------+-------+| innodb_fast_shutdown | 0 |+----------------------+-------+1 row in set (0.00 sec)[root@wallet01 ~]# service mysqld stopRedirecting to /bin/systemctl stop mysqld.service[root@wallet01 ~]# yum remove mysql-community*[root@wallet01 ~]# yum-config-manager --disable mysql56-community[root@wallet01 ~]# yum-config-manager --enable mysql57-community[root@wallet01 ~]# service mysqld startRedirecting to /bin/systemctl start mysqld.service[root@wallet01 ~]# mysql_upgrade -uroot -pabcd.1234mysql_upgrade: [Warning] Using a password on the command line interface can be insecure.Checking if update is needed.Checking server version.Running queries to upgrade MySQL server.Checking system database.mysql.columns_priv OKmysql.db OKmysql.engine_cost OKmysql.event OKmysql.func OKmysql.general_log OKmysql.gtid_executed OKmysql.help_category OKmysql.help_keyword OKmysql.help_relation OKmysql.help_topic OKmysql.innodb_index_stats OKmysql.innodb_table_stats OKmysql.ndb_binlog_index OKmysql.plugin OKmysql.proc OKmysql.procs_priv OKmysql.proxies_priv OKmysql.server_cost OKmysql.servers OKmysql.slave_master_info OKmysql.slave_relay_log_info OKmysql.slave_worker_info OKmysql.slow_log OKmysql.tables_priv OKmysql.time_zone OKmysql.time_zone_leap_second OKmysql.time_zone_name OKmysql.time_zone_transition OKmysql.time_zone_transition_type OKmysql.user OKUpgrading the sys schema.Checking databases.soe.customer OKsoe.district OKsoe.history OKsoe.item OKsoe.new_orders OKsoe.order_line OKsoe.orders OKsoe.stock OKsoe.warehouse OKsys.sys_config OKUpgrade process completed successfully.Checking if update is needed.[root@wallet01 ~]# mysql -uroot -pabcd.1234mysql> select version();+------------+| version() |+------------+| 5.7.32-log |+------------+1 row in set (0.00 sec)mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema || soe || sys |+--------------------+5 rows in set (0.00 sec)
版本兼容性MySQL 5.6mysql> select @@GLOBAL.sql_mode;+--------------------------------------------+| @@GLOBAL.sql_mode |+--------------------------------------------+| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |+--------------------------------------------+1 row in set (0.00 sec)mysql> select @@GLOBAL.optimizer_switch;+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| @@GLOBAL.optimizer_switch |+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,subquery_materialization_cost_based=on,use_index_extensions=on |+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+MySQL 5.7mysql> select @@GLOBAL.sql_mode;+-------------------------------------------------------------------------------------------------------------------------------------------+| @@GLOBAL.sql_mode |+-------------------------------------------------------------------------------------------------------------------------------------------+| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |+-------------------------------------------------------------------------------------------------------------------------------------------+1 row in set (0.00 sec)mysql> select @@GLOBAL.optimizer_switch;+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| @@GLOBAL.optimizer_switch |+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,mrr=on,mrr_cost_based=on,block_nested_loop=on,batched_key_access=off,materialization=on,semijoin=on,loosescan=on,firstmatch=on,duplicateweedout=on,subquery_materialization_cost_based=on,use_index_extensions=on,condition_fanout_filter=on,derived_merge=on |+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+1 row in set (0.00 sec)
更多相关文章
- Mac版本的Sublime Text常用快捷键
- Redis5.0中的内存淘汰策略详解(最新的版本)
- Springboot整合redis(Lettuce版本)
- Springboot整合mybatis(注解而且能看明白版本)
- 人手一套Linux环境之:Windows版本教程
- Java 的版本历史与特性
- 太强了!这两款数据库中间件,完美解决 Spring Boot 数据库的版本管
- Git 版本控制的核心概念[每日前端夜话0xC1]