r/PHPhelp • u/gmmarcus • Dec 17 '25
Adminer - CSV file 2 million rows
Guys, I need to import in a CSV file into a remote mariadb server. It has the adminer web gui - v 5.4.1.
However under 'Import' it says 'File Uploads are disabled. What is the method to enable file uploads ? Is that done on the adminer side or at the mariadb side ?
Also for 2 milion rows, is it adviseable to write a php script that can read the csv by chunks, condition the data and then insert ? or use the webgui ?
TIA !!!
1
Upvotes
6
u/eurosat7 Dec 17 '25
I would use a local command line tool on my pc. mysqlimport or something like mcsimport. So I can bypass the "upload" aspect of browser based solutions. Or dbeaver might work.
Or connect to the database and go with LOAD DATA INFILE LOCAL.
3
u/Troll_berry_pie Dec 17 '25
Why can't you use another client such as DBeaver?
3
u/MateusAzevedo Dec 17 '25
It always depends. Sometimes the web GUI won't handle a big file (upload size limit, it may try to read the entire file into memory...).
If you just need to import data "as is", I'd try a native solution like MySQL's
LOAD DATA INFILEor PostgreSQL'sCOPY.If data needs to be manipulated before inserting, a PHP script would be better.
2
u/hellocppdotdev Dec 17 '25
See if some of the techniques here would help
https://youtu.be/CAi4WEKOT4A
2
u/GrouchyInformation88 Dec 17 '25
Depending on the use case and how frequently I have to do stuff like this, sometimes I just open csv in excel and create a formula to concatenate and create sql statements. 2 million rows isn’t too bad. And if it is too much you could split it pretty easily and paste into a MySQL admin tool in 10 chunks or whatever.
2
u/Throwra_redditor141 Dec 19 '25
It’s terrible to import that large dataset from web gui, either use cli or write a script to import
1
u/ndepressivo Jan 01 '26
Take a look (with an open mind) at DuckDB; it masterfully solves these and other problems.