distal-attribute
distal-attribute
distal-attribute
distal-attribute

sql error(2007) Malformed packet

inbuffalo posted 1 year ago in Import/Export
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
inbuffalo posted 1 year ago
Forgot to mention information about MySQL

Server version: 5.5.32-cll - MySQL Community Server (GPL)
Protocol version: 10
jfalch posted 1 year ago
did you (or heidisql via import) use LOAD DATA LOCAL INFILE ? if so, has your serverĀ“s my.ini, [mysql] section,
local-infile=1 ? has to be explicitly enabled)
inbuffalo posted 1 year ago
The LOAD DATA LOW_PRIORITY LOCAL INFILE was used

I made a typo on the error number- should be 2027
/* SQL Error (2027): Malformed packet */

unable to locate the my.ini file
ansgar posted 1 year ago
Is that error reproducible? Looks more like a one-time error to me.
ansgar posted 1 year ago
Just getting exactly the same error here, on a local MySQL 5.5.8 server. wtf...
ansgar posted 1 year ago
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.

inbuffalo posted 1 year ago
Been getting the error on 5 plus attempts using the laptop with Windows 7. Have not been able to import yet

Always works with Windows XP

Will try the Client parser alternative
Thanks
ansgar posted 1 year ago
Shit... just found out the newer libmysql.dll I recently committed is causing this "malformed packet" error. See issue #3262.
ansgar posted 1 year ago
Seems to be a HeidiSQL issue, as I can fire the same LOAD command on the command line, using the same libmysql.
ansgar posted 1 year ago
* 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?
ansgar posted 1 year ago
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.
ansgar posted 1 year ago
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
jonlegras posted 4 weeks ago
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.

ansgar posted 4 weeks ago
Googling around I get the impression that both the client and server must have "enable-local-infile" activated. Is that the case on your server?
jonlegras posted 4 weeks ago
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).
ansgar posted 4 weeks ago
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.
jonlegras posted 4 weeks ago
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.

ansgar posted 4 weeks ago
Is it probably this bug in MySQL? http://bugs.mysql.com/bug.php?id=72107
ansgar posted 4 weeks ago
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?
ansgar posted 4 weeks ago
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:

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.

ansgar posted 4 weeks ago
I just replaced my libmysql from MariaDB 10.0.14/64bit with the one from MySQL 5.6.16/64bit, and it works! Even without calling

mysql_options(FHandle, MYSQL_OPT_LOCAL_INFILE, 0);



So, what's left to be done is testing whether MariaDB plugins still work now.
ansgar posted 4 weeks ago
r4854 updates libmysql.dll's to MySQL 5.6.21 version. Please check yourself by downloading the latest built *installer*.
ansgar posted 4 weeks ago
Pluggable authentication does not work any longer, but neither with the older version of libmysql. Hmm..
ansgar posted 3 weeks ago
jonlegras, I need some feedback from you for if the current installer with the new dll fixes that malformed packet problem for you too. I just don't want to be the only tester here, and I'm intending to make a new HeidiSQL release soon.
jonlegras posted 3 weeks ago
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.

jonlegras posted 3 weeks ago
I have imported quite a few more csv/txt files and everything seems good.
ansgar posted 3 weeks ago
Nice. So I have just released HeidiSQL v9.0.

Please login to leave a reply, or register at first.