I have HeidiSQL 8.0.0.4530 installed on both my computers.
When importing a CSV file on my laptop running Windows 7 Starter 32 bit operating system, the file did not upload into the database.
The system responded with the following message
sql error(2007) Malformed packet
I then imported the CSV file on my desktop computer running Windows XP professional Version 2002 Service Pack 3
Is there some setting that I need to make on my Windows 7 laptop computer to avoid this error?
Thanks
sql error(2007) Malformed packet
As an alternative in HeidiSQL, you can always use the "Method": "Client parser". I had introduced that alternative for users which lack the privilege to fire a LOAD DATA command. When chosing "Client parser", HeidiSQL goes through your CSV file itself, and generates extended INSERTs.
Shit... just found out the newer libmysql.dll I recently committed is causing this "malformed packet" error. See issue #3262.
* Reverting libmysql to MariaDB's v5.5.2 fixes this issue, but would break again a disconnect problem mentioned here.
* Using a libmysql from a MySQL (not MariaDB) server would most probably break pluggable authentication on MariaDB.
hmm... what code in HeidiSQL could cause this mess?
* Using a libmysql from a MySQL (not MariaDB) server would most probably break pluggable authentication on MariaDB.
hmm... what code in HeidiSQL could cause this mess?
Code modification/commit
0e02e6c
from ansgar.becker@gmail.com,
11 years ago,
revision 8.0.0.4531
Update libmysql again with a version from MariaDB 5.5.33a. Fix SQL error 2027 "malformed packet", when firing LOAD DATA command. See http://www.heidisql.com/forum.php?t=13454 and issue #3262.
Seems the current stable of MariaDB's libmysql (5.5.33 plus the "a" release also) does not have that "Malform packet" issue. Nothing in the changelog about that though.
r4531 exchanges the v5.5.32 to v5.5.33a .
There is a chance that pluggable authentication is broken again, so we need to wait for feedback in issue #3262. Just a gutt feeling, as HeidiSQL just reads "6.0.0" out of that libmysql now, even without "MariaDB" prefix.
r4531 exchanges the v5.5.32 to v5.5.33a .
There is a chance that pluggable authentication is broken again, so we need to wait for feedback in issue #3262. Just a gutt feeling, as HeidiSQL just reads "6.0.0" out of that libmysql now, even without "MariaDB" prefix.
Sorry for all the mess. r4532 fixes all issues here. Using a libmysql from MariaDB 5.3.12 now. And
* it's a 32 bit version (using a 64bit .dll in a 32bit executable was quite embarrassing...)
* it supports pluggable authentication
* finally it does not have the "malformed packet" in the LOAD DATA LOCAL INFILE command
* it's a 32 bit version (using a 64bit .dll in a 32bit executable was quite embarrassing...)
* it supports pluggable authentication
* finally it does not have the "malformed packet" in the LOAD DATA LOCAL INFILE command
Just downloaded the lastest build - 8.3.0.4851 64bit.
Our malformed packet friend when importing a csv seems to have returned.
It worked fine using Method:Client Parses File, but using Server I get the malformed packet.
Looking at the logs, v4827 included a refreshed libmysql.
Our malformed packet friend when importing a csv seems to have returned.
It worked fine using Method:Client Parses File, but using Server I get the malformed packet.
Looking at the logs, v4827 included a refreshed libmysql.
The server has the variable set "local_infile = ON" (this has always been the case as far as I know).
The server runs scripts that load csv files every day, and I also load csv files on a regular basis when testing things, and never had problems (apart from with the newer version of libmysql).
The server runs scripts that load csv files every day, and I also load csv files on a regular basis when testing things, and never had problems (apart from with the newer version of libmysql).
Ok, then we have two conflicting issues here: The old libmysql does not support the utf8mb4 charset, which HeidiSQL makes use of since recently. The newer libmysql crashes when firing a LOAD DATA command.
I tend to keep the newer libmysql, for the benefit of having utf8mb4. The CSV import can always be done with the "client" method, and we cannot ignore all coming updates for libmysql.
I tend to keep the newer libmysql, for the benefit of having utf8mb4. The CSV import can always be done with the "client" method, and we cannot ignore all coming updates for libmysql.
If it helps:
The tables I have are a mix of latin1_swedish_ci and utf8_general_ci formats.
In this case, the one I was loading into was latin1_swedish (i've not looked to see if uft8_general is different, but I've not had problems in the past).
The file being loaded was ASCII / PC / ANSI.
The tables I have are a mix of latin1_swedish_ci and utf8_general_ci formats.
In this case, the one I was loading into was latin1_swedish (i've not looked to see if uft8_general is different, but I've not had problems in the past).
The file being loaded was ASCII / PC / ANSI.
Is it probably this bug in MySQL? http://bugs.mysql.com/bug.php?id=72107
I see that on my localhost server, when I leave that "LOCAL" away from the LOAD DATA command, my imports work just fine. They take quite a long time on small files, but they work. But that surely does not work on remote servers, as the local files are not found there. Why's that so tricky?
On the command line, with the same libmysql, the LOAD DATA LOCAL command is working fine! I must be missing something. Some option to set, although I think I tested everything already:
This ClientFlags is required, otherwise the server would return some "The command is not allowed on this mysql server".
Ok, then I just added this one:
According to the documentation, that should work, but I still get "Malformed packet".
I'm stuck.
ClientFlags := CLIENT_LOCAL_FILES or CLIENT_INTERACTIVE or CLIENT_PROTOCOL_41 or CLIENT_MULTI_STATEMENTS;
Connected := mysql_real_connect(
FHandle,
PAnsiChar(Utf8Encode(FinalHost)),
PAnsiChar(Utf8Encode(FParameters.Username)),
PAnsiChar(Utf8Encode(FParameters.Password)),
nil,
FinalPort,
PAnsiChar(Utf8Encode(FinalSocket)),
ClientFlags
);
This ClientFlags is required, otherwise the server would return some "The command is not allowed on this mysql server".
Ok, then I just added this one:
mysql_options(FHandle, MYSQL_OPT_LOCAL_INFILE, pointer(1));
According to the documentation, that should work, but I still get "Malformed packet".
I'm stuck.
Code modification/commit
9c0d093
from ansgar.becker,
10 years ago,
revision 8.3.0.4854
Fix sql error(2007) Malformed packet, happening on MariaDB-versions of libmysql. Prefer MySQL 5.6.21 versions now. See http://www.heidisql.com/forum.php?t=13454
r4854 updates libmysql.dll's to MySQL 5.6.21 version. Please check yourself by downloading the latest built *installer*.
I've had a quick look, and so far seems to be working fine.
I downloaded 8.3.0.4863 full 32/64 installer. Found a csv file I had floating around and gave it a go.
Because I had been using 'client parse', this was the first test. Then repeated with the 'server parse' option.
Everything working as expected. As I use csv imports quite a lot, I'm sure I'll give it plenty more testing soon. Will let you know if there are any problems.
I downloaded 8.3.0.4863 full 32/64 installer. Found a csv file I had floating around and gave it a go.
Because I had been using 'client parse', this was the first test. Then repeated with the 'server parse' option.
Everything working as expected. As I use csv imports quite a lot, I'm sure I'll give it plenty more testing soon. Will let you know if there are any problems.
Please login to leave a reply, or register at first.