当前位置:网站首页>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
边栏推荐
- 基于微信小程序的青少年生理健康知识小助手(免费获取源码+项目介绍+运行介绍+运行截图+论文)
- π盘,让您电脑变成个人的私有云
- Web Security (IX) what is JWT?
- 从诺奖知“边缘计算”的未来!
- 运行时候的导包搜索路径虽然pycharm中标红但不影响程序的执行
- Ssm+mysql second-hand trading website (thesis + source code access link)
- LeetCode 最大矩形,最大正方形系列 84. 85. 221. 1277. 1725. (单调栈,动态规划)
- HDU - 1024 Max Sum Plus Plus(DP)
- [SRS] use of Vhost isolated stream: push / pull Stream Address
- 从底层结构开始学习FPGA----RAM IP的定制与测试
猜你喜欢

Summary of common components of applet

This is the necessary software for college students 𞓜 knowledge management

Qt编写自定义控件-自绘电池

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

Unity project experience summary

Simple implementation of database connection pool

多表操作-外键级联操作

MySQL数据迁移遇到的一些错误

boot+jsp的高校社團管理系統(附源碼下載鏈接)

Multi table operation - foreign key cascade operation
随机推荐
基于微信小程序的青少年生理健康知识小助手(免费获取源码+项目介绍+运行介绍+运行截图+论文)
加密狗资料搜集
Beauty of Mathematics - Application of Mathematics
json数据比较器
Qt编写自定义控件-自绘电池
运行时候的导包搜索路径虽然pycharm中标红但不影响程序的执行
MySQL converts milliseconds to time string
穿越派·派盘 + Mountain Duck = 数据本地管理
C语言初阶——实现扫雷游戏
论文学习记录随笔 多标签之LIFT
Ssgssrcsr differences
论文学习记录随笔 多标签之GLOCAL
C语言初阶——牛客网精选好题
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
穿越派与贸大合作,为大学生增添效率
Build 2022 上开发者最应关注的七大方向主要技术更新
Redis database deployment and common commands
[SRS] use of Vhost isolated stream: push / pull Stream Address
云盘里资料被和谐了,怎么办?