In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail about MYSQL SOURCE error ERROR: ASCII how to do, Xiaobian think quite practical, so share to everyone as a reference, I hope you can read this article after harvest.
MYSQL SOURCE error due to ASCII '\0'
A friend made a mistake:
source test.sql
ERROR:
ASCII '\0' appeared in the statement, but this is not allowed unless option
--binary-mode is enabled and mysql is run in non-interactive mode. Set --bin
ary-mode to 1 if ASCII '\0' is expected. Query: ''.
I haven't seen this mistake before, so I took a closer look. First, check the meaning of--binary-mode according to the error report:
--binary-mode By default, ASCII '\0' is disallowed and '\r\n' is
translated to '\n'. This switch turns off both features,
and also turns off parsing of all clientcommands except
\C and DELIMITER, in non-interactive mode (for input
piped to mysql or loaded using the 'source' command).
This is necessary when processing output from mysqlbinlog
that may contain blobs.
ASCII '\0' is not allowed except in binary mode, so why not?
The reason is that a sql script in text mode cannot have '\0','\0'corresponding to ASCII 00,NUL,
We know that in plain text mode, any character corresponds to its own encoding, even spaces, linefeeds, carriage returns, tabs, etc.
, 00 NUL will only be available in binary mode files, when using non-interactive mode, such as
in mysqlbinlog| mysql -u root -p is closed when used, but I tested it and it didn't work.
Neither pipe nor redirection works:
[root@testmy ~]# cat test.sql|/mysqldata/mysql5.7/bin/mysql --socket=/mysqldata/mysql5.7/mysqld3307.sock
ERROR: ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode is enabled and mysql is run in non-interactive mode. Set --binary-mode to 1 if ASCII '\0' is expected. Query: ''.
[root@testmy ~]# /mysqldata/mysql5.7/bin/mysql --socket=/mysqldata/mysql5.7/mysqld3307.sock
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
Rpm==== overview of package management for Linux systems: in this chapter
© 2024 shulou.com SLNews company. All rights reserved.