workbench 批量导入sql文报错的几点记录

本文详细记录了在使用mysql.exe导入SQL文件时遇到的三种常见错误及其解决方案,包括'NO_AUTO_CREATE_USER'设置问题、函数声明问题以及本地主机名引用问题。通过修改SQL文件中的特定设置和语法,成功解决了导入过程中的错误。

导入:
11:47:11 Restoring D:\project\XXXXXXXX.sql
Running: mysql.exe --defaults-file="c:\users\sam\appdata\local\temp\tmpt6aeix.cnf"  --protocol=tcp --host=192.168.9.28 --user=root --port=3306 --default-character-set=utf8 --comments  < "D:\\project\\天天SRM\\trunk\\04代码管理\\01后台服务端\\tterp\\db\\20190817\\Dump20190817.sql"
ERROR 1231 (42000) at line 2116: Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'

Operation failed with exitcode 1
11:47:42 Import of D:\project\XXXXXXXX.sql has finished with 1 errors

解决方案:'NO_AUTO_CREATE_USER' 替换为空


11:48:35 Restoring D:\project\XXXXXXXXsql
Running: mysql.exe --defaults-file="c:\users\sam\appdata\local\temp\tmprhklvr.cnf"  --protocol=tcp --host=192.168.9.28 --user=root --port=3306 --default-character-set=utf8 --comments  < "D:\\project\\XXXXXXXX.sql"
ERROR 1418 (HY000) at line 2118: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
Operation failed with exitcode 1
11:49:08 Import of D:\project\XXXXXXXX.sql has finished with 1 errors
解决方案:'locahost' 替换为ip地址

11:43:04 Restoring D:\project\XXXXXXXX.sql
Running: mysql.exe --defaults-file="c:\users\sam\appdata\local\temp\tmprj9etu.cnf"  --protocol=tcp --host=192.168.9.28 --user=root --port=3306 --default-character-set=utf8 --comments  < "D:\\project\\XXXXXXXX.sql"
ERROR 1418 (HY000) at line 5593: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

Operation failed with exitcode 1
12:00:08 Import of D:\XXXXXXXX.sql has finished with 1 errors

解决方案:function begin  前添加    DETERMINISTIC

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值