Problem importing zipped CSV into a database

Tjay322

Registered
May 10, 2017
1
0
1
Aus
cPanel Access Level
Website Owner
I've been using phpmyadmin for importing and exporting tables without too much trouble, but after the latest update it seems to not work properly? Before there was an option to 'replace table data with file' which I would use if there was any problems and it was working well. This is no longer an option and when I upload a .csv I'm just getting a blank page after the upload is finished, no info no error message just blank?

So I'm wondering what's the best practice for uploading .csv tables and zipped .csv files?

Most of the time I'm just adding to the content already there using MS excel then saving as normal. I'm not adding new columns, sometimes deleting rows.

Now the particular file I'm uploading is around 500mb but zipped up it's around 7mb, I've increased the upload limit and time via WHM. I have dealt with files this large before with the old version without any problem so I'm confused why this version is playing up or I'm not doing something right? I'm including the column names when uploading, disabling partial import and choosing Do not abort on INSERT error.

I've got this message when on the home page of phpmyadmin:
Your PHP MySQL library version 5.1.73 differs from your MySQL server version 5.5.54. This may cause unpredictable behavior.

Would this be causing it?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,229
463
Hello,

Here's a quote from one of our Technical Analysts regarding the topic of importing CSV files via phpMyAdmin in a recent support request:

In order to import a CSV file using phpMyAdmin, the user using phpMyAdmin must have the FILE permission, which is described below. The FILE privilege gives you permission to read and write files on the server host using the LOAD DATA INFILE and SELECT ... INTO OUTFILE statements and the LOAD_FILE() function. A user who has the FILE privilege can read any file on the server host that is either world-readable or readable by the MySQL server. (This implies the user can read any file in any database directory, because the server can access any of those files.) The FILE privilege also enables the user to create new files in any directory where the MySQL server has write access. This includes the server's data directory containing the files that implement the privilege tables. As a security measure, the server will not overwrite existing files.

There are two solutions to your issue.

1. As 'root', you have the ability to perform the import, and as such, you can perform the import in WHM -> SQL Services -> phpMyAdmin yourself. There is little risk (that I'm aware of) specific to importing a CSV file. The risk is with giving the user the ability to read and/or write files on your filesystem.

2. The third-party documentation at < Converting a CSV to SQL using 1 line in bash > describes how to convert a CSV file to a .sql file.
Regarding your other question:

I've got this message when on the home page of phpmyadmin:
Your PHP MySQL library version 5.1.73 differs from your MySQL server version 5.5.54. This may cause unpredictable behavior.
This topic is discussed on the following thread:

Phpmyadmin - PHP MySQL library version

Thank you.