percona 5.6升级到5.7相关error及解决方法

今早,把开发环境的mysql升级到了5.7.15,5.6数据导入后,启动一切正常,检查.err日志,发现有如下异常:

2016-10-31T00:29:33.187073Z 0 [Warning] System table 'time_zone_leap_second' is expected to be transactional.
2016-10-31T00:29:33.187093Z 0 [Warning] System table 'time_zone_name' is expected to be transactional.
2016-10-31T00:29:33.187097Z 0 [Warning] System table 'time_zone' is expected to be transactional.
2016-10-31T00:29:33.187101Z 0 [Warning] System table 'time_zone_transition_type' is expected to be transactional.
2016-10-31T00:29:33.187104Z 0 [Warning] System table 'time_zone_transition' is expected to be transactional.
2016-10-31T00:29:33.187690Z 0 [Warning] System table 'servers' is expected to be transactional.
2016-10-31T00:29:33.188536Z 0 [Warning] Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened.
2016-10-31T00:29:33.188827Z 0 [Warning] Info table is not ready to be used. Table 'mysql.slave_relay_log_info' cannot be opened.
2016-10-31T00:29:33.195026Z 0 [ERROR] Incorrect definition of table mysql.db: expected column 'User' at position 2 to have type char(32), found type char(16).
2016-10-31T00:29:33.195055Z 0 [ERROR] mysql.user has no `Event_priv` column at position 28
2016-10-31T00:29:33.195236Z 0 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.

执行mysql_update进行升级即可。

相关5.7不兼容的mysql参数包括如下:

max_statement_time=300000,由mysql自身参数max_execution_time控制。

innodb_log_block_size=4096,由mysql自身参数innodb_log_write_ahead_size控制。

还有一个问题是,通过service mysql start启动后,service mysql stop无法删除${hostname}.pid文件,看support-files提供的mysql.server文件又是有rm *.pid命令的,事后得再看下哪里的问题。

另外,其他一些常用变化如下:

1、在mysql 5.6中,开始innodb监控的方法(这在mysqld hang,mysql客户端本身就无法登录进去的时候是很有用的)如下:

use mysql;

CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB;

在mysql 5.7下,调整为如下:

set GLOBAL innodb_status_output=ON;

2、正规的创建用户、修改密码方式调整为接近oracle的语法:

5.6:

grant all on *.* to root@'172.18.%' identified by "password";

set password for root@'172.18.%'=password('password');

5.7:

create user root@'172.18.%' identified by 'ABC123!@#';

alter  user root@'172.18.%' identified by 'ABC123!@#'; --用户必须已经存在

3、datadir下新增的文件及其含义如下:

ib_buffer_pool

Even though a buffer pool can be many gigabytes in size, the buffer pool data that InnoDB saves to disk is tiny by comparison. Only tablespace IDs and page IDs necessary to locate the appropriate pages are saved to disk. This information is derived from the INNODB_BUFFER_PAGE_LRU INFORMATION_SCHEMA table. By default, tablespace ID and page ID data is saved in a file named ib_buffer_pool, which is saved to the InnoDB data directory. The file name and location can be modified using the innodb_buffer_pool_filename configuration parameter.

ibtmp1

In 5.7, InnoDB added a separate tablespace for all non-compressed InnoDB temporary tables. This new tablespace is named ibtmp1 and is located in the datadir by default.

“The new tablespace is always recreated on server startup. … A newly added configuration file option, innodb_temp_data_file_path, allows for a user-defined temporary data file path. For related information, see InnoDB Temporary Table Undo Logs.”

mysqld_safe.pid

In MySQL 5.7.2 and later, mysqld_safe creates a PID file named mysqld_safe.pid in the MySQL data directory when starting up

xb_doublewrite

percona扩展,Regardless of innodb_flush_method setting, the parallel doublewrite file is opened with O_DIRECT flag to remove OS caching, then its access is further governed by the exact value set: if it’s set to O_DSYNC, the parallel doublewrite is opened with O_SYNC flag too. Further, if it’s one of O_DSYNCO_DIRECT_NO_FSYNC, or ALL_O_DIRECT, then the doublewrite file is not flushed after a batch of writes to it is completed.由参数innodb_parallel_doublewrite_path控制其目录,It defaults to xb_doublewrite in the data directory. 

sys:

performance_schema之上的视图库。

原文地址:https://www.cnblogs.com/zhjh256/p/6014676.html