当前位置:网站首页>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
边栏推荐
- 导数的左右极限和左右导数的辨析
- Through cooperation with the University of international trade, we can increase efficiency for college students
- 激活函数简述
- Wild melon or split melon?
- Trust guessing numbers game
- 扩展点系列之SmartInstantiationAwareBeanPostProcessor确定执行哪一个构造方法 - 第432篇
- libpng12.so.0: cannot open shared object file: No such file or directory 亲测有效
- Mongodb学习篇:安装后的入门第一课
- 加密狗资料搜集
- mysql 将毫秒数转为时间字符串
猜你喜欢

Leetcode top 100 question 2 Add two numbers

穿越派 你的数据云行

千万不要把笔记视频乱放!

【QT】qt加减乘除之后,保留小数点后两位

HCM 初学 ( 一 ) - 简介
Educational administration management system of SSM (free source code)

It's not that you have a bad mind, but that you haven't found the right tool

论文学习记录随笔 多标签之LSML

Geoffrey Hinton:我的五十年深度学习生涯与研究心法

C语言初阶——实现扫雷游戏
随机推荐
Unity uses SQLite
tese_ Time_ 2h
boot+jsp的高校社团管理系统(附源码下载链接)
新手在挖财开通证券账户安全吗?
码蹄集 - MT3114 · 有趣的平衡 - 用样例通俗地讲解
Ssgssrcsr differences
Build 2022 上开发者最应关注的七大方向主要技术更新
Leetcode top 100 question 2 Add two numbers
[SRS] use of Vhost isolated stream: push / pull Stream Address
2022.6.30-----leetcode.1175
Summary of common components of applet
【知识点总结】卡方分布,t分布,F分布
Orcle创建用户+角色
我从技术到产品经理的几点体会
2022第八届中国国际“互联网+”大学生创新创业大赛产业命题赛道开启报名!
4GB大文件,如何实时远程传输和共享?
HDU - 1024 Max Sum Plus Plus(DP)
从诺奖知“边缘计算”的未来!
穿越派 你的数据云行
Mongodb學習篇:安裝後的入門第一課