Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSV Insert to MYSQL

Featured Replies

I'm having a bit of difficulty importing a csv into mysql. Just wondering if someone can give me a bit of direction on a better practice.

 

Basically my csv has around 3000 rows and weighs in around 11MB. Until now i have just been copying the first 100 rows into a seperate csv just to keep the load light for testing. I have simply used the Import function in phpMyAdmin and it has worked fine and simply creates a new table which i can then rename.

 

Now if i use the same practice for the large csv it uploads and then goes to a white screen and doesn't create the new table.

 

I assume this is due to the size of the file and the time it takes to execute. So any ideas ?

 

Thanks in advance folks !

If you can access the server's shell you can use mysqlimport. Or you can write a simple importer script if you have only ftp access.

  • Author

Thanks guys .. i got there in the end. Turned out that my server had no issues with the 11MB file size (and it's never gonna get any bigger) .. The problem actually lay with an error in the csv file. What i found was that after opening with OpenOffice Calc and making some amendments OpenOffice was saving all the empty columns. For example .. if you open a csv in OpenOffice and scroll right to your last column, go a little too far right and OpenOffice will just keep adding empty columns. It then save these empty columns with a comma like my example code below.

 

"vehicle_id","dealer_id","make","model","model","Varianttext","price","mileage","reg","year","colour","engine","bodystyle","seller_name","seller_email","seller_phone","title","description","fueltype","numberofdoors","site_link","capid","imagerefs","features","exclude_for_ukdirect","cap_features","transmission","vehicle_type","was_price","date_registered","bhp",-1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

 

So what i did was simply copy the columns into a new Calc database and saved it .. this way all the additional blank columns where gone and it has been working flawlessly since.

 

Thanks for your help and suggestions guys !!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.