当前位置:网站首页>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
边栏推荐
- MySQL converts milliseconds to time string
- Speed regulation and stroke control based on Ti drv8424 driving stepper motor
- HCM 初学 ( 三 ) - 快速输入PA70、PA71 浏览员工信息PA10
- tese_Time_2h
- JSON data comparer
- π盘,让您电脑变成个人的私有云
- mysql 将毫秒数转为时间字符串
- win10、win11中Elan触摸板滚动方向反转、启动“双指点击打开右键菜单“、“双指滚动“
- 穿越派 你的数据云行
- Fiber Bragg grating (FBG) notes [1]: waveguide structure and Bragg wavelength derivation
猜你喜欢

Multi table operation - foreign key cascade operation

Huluer app help

Trust guessing numbers game

【医学分割】u2net

He struggled day and night to protect his data

scope 数据导出mat
![Fiber Bragg grating (FBG) notes [1]: waveguide structure and Bragg wavelength derivation](/img/83/97c0c6e23cbb7b4c2b630c217c5206.jpg)
Fiber Bragg grating (FBG) notes [1]: waveguide structure and Bragg wavelength derivation

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

Chapitre d'apprentissage mongodb: Introduction à la première leçon après l'installation

导数的左右极限和左右导数的辨析
随机推荐
【考研高数 武忠祥+880版 自用】高数第二章基础阶段思维导图
Mongodb學習篇:安裝後的入門第一課
如何添加葫芦儿派盘
论文学习记录随笔 多标签之LSML
Is it safe for a novice to open a securities account?
Boot + jsp University Community Management System (with source Download Link)
Floweable source code annotation (40) class delegation
[excel] column operation, which performs specific column for data in a cell, such as text division by comma, colon, space, etc
Don't put your notes and videos everywhere!
Ssm+mysql second-hand trading website (thesis + source code access link)
It's not that you have a bad mind, but that you haven't found the right tool
Advanced cross platform application development (III): online resource upgrade / hot update with uni app
码蹄集 - MT3149 · AND - 数据不是很强,暴力剪枝就能骗AC
Call us special providers of personal cloud services for College Students
亲爱的派盘用户,我要向您表白!
2/15 (awk, awk conditions, awk processing design can perform additional tasks, and use awk array +for loop to realize advanced search)
码蹄集 - MT3114 · 有趣的平衡 - 用样例通俗地讲解
Mongodb学习篇:安装后的入门第一课
boot+jsp的高校社团管理系统(附源码下载链接)
2022 the 8th China International "Internet +" college student innovation and entrepreneurship competition industry proposition track is open for registration!