当前位置:网站首页>Some errors encountered in MySQL data migration
Some errors encountered in MySQL data migration
2022-07-01 05:44:00 【Rippling ocean】
background
Doing it MYSQL When migrating databases , Some problems , Record these questions , For future reference
sql_mode
Many verifications are combined with this mode There is a direct connection
## Import sql file , The following error occurred
MySQL:[Err] 1292 - Incorrect datetime value: '0000-00-00 00:00:00' for column 'CREATE_TIME' at row 1Cause
This is due to the current MySQL I won't support it datetime by 0 The state of .
Check and select the current sql_mode
select @@global.sql_mode;
Solution
Set current sql_mode
## At present
set @@sql_mode = 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';Get into mysql Execute the command in the command interface
## overall situation
set @@global.sql_mode = 'STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';PS: Both of the above methods can temporarily solve the problem , But when the database restarts , Previous modifications will be invalid
modify my.ini The configuration file
Only modify the configuration file , To solve this problem forever , stay my.ini Add... To the file
sql_mode = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONRe execution select @@global.sql_mode;

Always report errors that do not exist in the form
Confirm that the table exists , But there is no error in the query table , At this point, it may be because you think mysql Case sensitive , This configuration can be modified
stay my.ini The following code is added to the file
## Use this command to view the case sensitive configuration in the current system
show global variables like '%case%';## lower_case_file_system The system is case sensitive - There is no need to change
## lower_case_table_names Currently case sensitive , Need to change to 1
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| lower_case_file_system | OFF |
| lower_case_table_names | 0 |
+------------------------+-------+
2 rows in set (0.01 sec)
lower_case_table_names = 1After adding configuration , Restart the service and check again
Problem solved , If it is not configured in the configuration file , The service will restart next time , Invalidate the previous configuration , There are some problems that are not easy to check , therefore , If it doesn't need to be modified temporarily , Are modified in the configuration file
边栏推荐
- Why use huluer pie disk instead of U disk?
- [excel] column operation, which performs specific column for data in a cell, such as text division by comma, colon, space, etc
- 数据治理:数据治理管理(第五篇)
- MySQL数据迁移遇到的一些错误
- Data governance: data governance framework (Part I)
- A little assistant for teenagers' physiological health knowledge based on wechat applet (free source code + project introduction + operation introduction + operation screenshot + Thesis)
- 基于微信小程序的青少年生理健康知识小助手(免费获取源码+项目介绍+运行介绍+运行截图+论文)
- Vscode function annotation / file header annotation shortcut
- Actual combat: basic use of Redux
- Chapitre d'apprentissage mongodb: Introduction à la première leçon après l'installation
猜你喜欢

小程序常用组件小结

Continuous breakthrough and steady progress -- Review and Prospect of cross platform development technology of mobile terminal

On the first day of the new year, 3000 Apache servers went down

【考研高数 武忠祥+880版 自用】高数第二章基础阶段思维导图

mysql 将毫秒数转为时间字符串

Why use huluer pie disk instead of U disk?

扩展点系列之SmartInstantiationAwareBeanPostProcessor确定执行哪一个构造方法 - 第432篇

excel高级绘图技巧100讲(一)-用甘特图来展示项目进度情况

Multi table operation - foreign key cascade operation

Huluer app help
随机推荐
2/15 (awk, awk conditions, awk processing design can perform additional tasks, and use awk array +for loop to realize advanced search)
小程序常用组件小结
boot+jsp的高校社團管理系統(附源碼下載鏈接)
Set集合詳細講解
导数的左右极限和左右导数的辨析
Codeforces Round #803 (Div. 2)vp
Is it safe for a novice to open a securities account?
libpng12.so.0: cannot open shared object file: No such file or directory 亲测有效
移动端常用解决方案
C语言初阶——牛客网精选好题
4GB大文件,如何实时远程传输和共享?
bat操作ftp上传下载命令
Simple implementation of database connection pool
Detailed explanation of set
excel高级绘图技巧100讲(一)-用甘特图来展示项目进度情况
Huluer app help
Mongodb learning chapter: introduction after installation lesson 1
Web Security (IX) what is JWT?
Actual combat: basic use of Redux
Xuanyi maintenance manual