Question

Successful excel file import into MySQL says copied all 533 rows, but only 127 are showing up!

Asked by: Jeff83

I am using phpMyAdmin 2.9.1.1 to access my MySQL database.

I finally was able to figure out how the heck to import 533 lines of data from an excel file successfully- in fact after I import it, it says, "Import has been successfully finished, 533 queries executed."

However, when I go back to the main screen and check the records in the table, it only shows it has 127 rows of data.

So, it's saying that it copied over with no problem, but more than half of the rows aren't present. There isn't any type of row limit on a table, is there? Even so, 127 seems like hardly anything, depending on what you are doing.

Any insight you can offer would be greatly appreciated.

Thank you,
             Jeff

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-07-06 at 12:10:52ID22680112
Tags

excel

,

import

,

mysql

,

file

Topics

MySQL Server

,

Databases Miscellaneous

,

PHP and Databases

Participating Experts
4
Points
200
Comments
21

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. how to create relationships in mysql using phpMyAdmin
    Hai all, I want to know how to create relationships between the tables in mysql using phpMyAdmin software. Anyone who r familiar with it pls solve my problem Thankyou Manju
  2. phpmyadmin and mysql simple question
    I have all my phpmyadmin setup and mysql server is running. My website is under apache server. I got the program off the web which is easyphp and it install apache , php and mysql for you and it runs without changing any configrations. my all website files are under the d...
  3. mysql phpmyadmin
    i am trying to install a module in postnuke the instruction says" Next using phpMySQLAdmin or similar, create your tables by posting the contents of phpwebsite_calendar.sql as a SQL query or manually create the tables. You also need to post the following to avoid the SQ...
  4. Granting privilges to mySQL database/phpMyAdmin
    I have mySQL set up and running. I can access the server using user/password. I also have phpMyAdmin running as I am setting up osCommerce on this server: Welcome to phpMyAdmin 2.5.6 MySQL 3.23.54 running on localhost as mdavis@localhost MySQL Create new database: [Docu...
  5. phpMyAdmin and MySQL
    Hi ee Having converted Access to MySQL, how do i then upload it onto the server (on internet)- can i do this through phpMyAdmin? Seb

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: todd_farmerPosted on 2007-07-06 at 12:26:41ID: 19434344

It sounds as though some of the queries that phpMyAdmin created failed.  Have you tried exporting the data from Excel to comma-delimited format and then importing?

 

by: ncooPosted on 2007-07-06 at 12:28:03ID: 19434356

Does the excel file contain duplicate rows/primary keys?

There isn't really a limit on number of rows the server will probably full over first.

 

by: Jeff83Posted on 2007-07-06 at 13:30:41ID: 19434786

Actually, I should've been more clear- I'm quite new at all of this so I do apologize.

The file that I imported was a Comma-delimited file that I created from an Excel document. So, yes I did try that.

When you open up the CSV in Excel- the ID column does not have any repeating numbers at all, and there are no duplicate columns...

- Jeff

 

by: ncooPosted on 2007-07-06 at 13:41:24ID: 19434883

When you reopen the CSV in Excel are all the columns / rows correct, i.e. no cells have two cell values or have "" when you don't expect it?

 

by: jmar_clickPosted on 2007-07-06 at 13:50:58ID: 19434936

Do any of the records themselves have commas in them? (just covering the basics)

Also make sure that all the records have the fields required by your mysql tables.

Try splitting your data into chunks of 150 records, then import them separetly. You might find that one batch has errors in one or more records.

 

by: Jeff83Posted on 2007-07-06 at 13:54:13ID: 19434963

Yeah, when I open up the CSV Excel file, everything looks normal. Well, sometimes some longer numbers because ###### only because the column isn't wide enough- but.. just adjust the column and it's fine. There aren't any quotes (") anywhere in any cell. I do have a comma in a few fields though like, for example, there is an address field which might say ... Rockland,NewMexico   but other than periods in an email address, there is no other random punctuation in any field. Some fields are blank- but they are supposed to be- because we don't have someone's phone number for example, so that field is left with nothing in it.

 

by: jmar_clickPosted on 2007-07-06 at 14:00:19ID: 19435003

I asked about commas because if you're importing a comma delimited field, when phpMyadmin is trying to read the records it's assuming a new column starts when it finds a comma. So it might be thinking that your address field is 2 fields instead of one.

Try using a TAB delimited field.

 

by: jmar_clickPosted on 2007-07-06 at 14:01:25ID: 19435014

also, for fields that are empty in the file you are importing. Make sure that the corresponding field in the table is not set to "required"

 

by: ncooPosted on 2007-07-06 at 14:05:10ID: 19435042

I am sure excel exports CSV as "value","value" so a , in a value should not matter, but no harm trying.

 

by: Jeff83Posted on 2007-07-06 at 14:23:30ID: 19435168

I will try the TAB format instead and I'll see what happens-

Also I do have some rows that are duplicates- but they aren't exact duplicates- like the first and last name is exactly the same but other information down the row is different, that shouldn't matter right? They both have unique ids....

I'll try the TAB format but I won't have access to a computer later tonight- I'll write back with the status tomorrow.

 

by: Jeff83Posted on 2007-07-06 at 14:28:37ID: 19435212

I did write one response that for some reason, I just noticed, didn't get posted-

When I'm saving the Excel file as a CSV, a window pops up:

Table.csv (or even .txt in the case of the TAB format) may contain features that are not compatible with Text (Tab delimited) or Comma (Comma delimited). Do you want to keep the workbook in this format?

To keep this format, which leaves out any incompatible features, click YES (this is what I select)
To preserve the features, click no. Then save a copy in the latest Excel format.
To see what might be lost, click Help.

Yes, No, Help

When I read the help file, the types of things it tells you are lost by saving it as a CSV or Text Tab file, aren't in any of the fields- so I'm really not sure what features it is talking about, but I figure that if I click Yes, to leave out the incompatible features, then it isn't much of an issue- but since we are troubleshooting, thought it was important to mention.

- Jeff

 

by: ncooPosted on 2007-07-06 at 14:32:38ID: 19435238

Can you paste a line of the CSV which fails to insert, replace private information with x's but leave everything else intact.

 

by: evilolivePosted on 2007-07-06 at 19:04:16ID: 19436091

I have a guess at this, which is far from what many people are thinking, and it may or may not be correct.  I had an issue quite like this where about 100-160 records would write but the rest, no matter how many more, would fail.  This occurred in a windoze environment.  When I moved the same exact (yes, completely unchanged) script  to my Linux server, every record was entered flawlessly, every time.

My initial thought on that problem was:

Yet another open source project that does not play friendly with Micro$oft. Projects ported to windoze do not always work as expected.

My Workaround:  Only move about 110-120 records at a time, and watch to make sure that they are all successful.

My Solution: Format hard drive and install a linux disto.

You may already be running this script on a linux platform. If so, please disregard this comment.

 

by: evilolivePosted on 2007-07-06 at 19:22:46ID: 19436120

One addition, this message:

Table.csv (or even .txt in the case of the TAB format) may contain features that are not compatible with Text (Tab delimited) or Comma (Comma delimited). Do you want to keep the workbook in this format?


is completely normal.  That is the message you get no matter what when you try to save an Excel file as tab/comma delimited.  Just select yes to save.  That message is what I like to call "Micro$oft trying to do more for you."  This only refers to losing proprietary excel formatting when saving as this file type (which is what you want).

 

by: Jeff83Posted on 2007-07-09 at 09:21:14ID: 19446452

Sorry I haven't written in a few days- weekend was busier than expected.

Anyway- I went to export the TAB file from excel- not a problem. However, when I signed into the phpMyAdmin, I am unable to import TAB files. All I have the option to import is CSV, CSV using Load Data, or SQL.

What I'm going to try to do is to split up the CSV file and do separate imports to see if that helps. Granted- this is by no means ideal because the CSV file has like six hundred records and I'll have to be using the 'import' option often to get new data into the database- but for the sake of troubleshooting, I'm going to try it and report back in a little bit.

The database is a Web-based database, so no files are being accessed from my computer. A user can input information into the database via a .php page that is housed on my webspace.

As a response to Evilolive- I believe that my webspace is housed on a Linux server. I could be wrong- I honestly don't know much about it, but it was my understanding that if it were a Microsoft server, I'd have to be using ASP, not PHP. Correct me if I'm wrong though.

Ok I'll write back in a bit. And for NCOO, I will paste a line from the line for you- when I write a response back to see how it went.

- Jeff

 

by: Jeff83Posted on 2007-07-09 at 09:52:26ID: 19446710

Well- I got it to work- but I'm honestly not sure what was going on.

For the first time ever, it gave me an error when I went to import it and not all of the fields copied over. It usually just says "success! 129 entries copied" ... when the file had like over 500. But when I went to do it again, this time it gave me an error saying that there was a duplicate entry at line 127.

I looked all around line 127 for anything of the sort, but found absolutely nothing. No weird punctuations hanging around, definitely no exact dupe, but I copied all of the fields in the document, and then pasted it into a brand new one. Since excel sheets scroll to infinity, my initial feeling was, eh, maybe there is something weird 100,000 cells away somehow. Well, when I pasted it into the new document, saved in, and then imported it, everything worked just fine.

So, I'm really not sure what the issue was. I scrolled out pretty far and for as far as I saw, there wasn't anything funky, but pasting it into a new excel/csv file seemed to work....

so, I guess this issue.... is ... done?

 

by: Jeff83Posted on 2007-07-09 at 10:01:20ID: 19446779

EH! WRONG!

Spoke to soon, I guess....

Although it said it was fine, when I go back, I see that it does indeed stop at record 127.

1-127 are fine, but then on line 128, it displays one last record which is someone with the last name beginning with "Y" which is one of the last rows in the file of 533 entries.

So, something is funky with line 127, but I can't figure it out for the life of me.... it looks fine.

Here it is:

id         first      last        address         town     state    zip          phone              course  major    term
127      XXX    XXXX  XX XXX XXXX    Xville      XX   XXXXX  XXX-XXX-XXXX   XXX       XXX      XXXXX      
email                                   profession        date created
XXXXX@XXXX.XXX                 XXXXX            X/X/XXXX

What I'm going to do now is to take this row out of the file, and see what happens....

Sorry for the false alarm of solving this...

 

by: Jeff83Posted on 2007-07-09 at 10:17:55ID: 19446921

I tried to split the csv file from records 1-127 and then 128-end

Interesting- line 127 imports just fine on the first file

But then I go to import the second half, and I get the same following error:


MySQL said: Documentation
#1062 - Duplicate entry '127' for key 1

Update--

yeah, I've tried just about everything. Once it gets to record 127, it just ... stops. I even tried creating a new line for it (not by means of importing) but just tried to insert a line in, it won't let me do it. It just gives me the same #1062 error- as if the table can't hold more than 127 rows....

 

by: Jeff83Posted on 2007-07-09 at 10:53:40ID: 19447214

Also- since I'm not sure what the issue is, I'm trying everything-

At first my csv files- the first line of the excel file was all of the column names, and then the second line was "1" and then started to contain information. But then I thought, hey wait, phpMyAdmin requires you to type in the column names in a text field before you submit the file for import- I thought to myself .. Hey, maybe you don't need to have them in your csv file also- maybe just have line 1 in excel be the first record-- this seemed to import just fine without the column names listed- which was cool, but it still didn't solve the problem of not getting past record 127

 

by: Jeff83Posted on 2007-07-09 at 12:02:40ID: 19447818

The problem has been fixed-

The records were stopping at 127 because the id field was type tinyint(4).

So if you ever hear someone come across the same issue at row 127, that's likely to be it.

-Jeff

 

by: ncooPosted on 2007-07-09 at 12:16:54ID: 19447952

Glad you got that fixed now, thanks for letting us know how you solved it. Still very strange how it does the first 127 records and then the last record.

I was going to suggest next maybe writing a php script to read the cvs file and inserting one row at a time with echo errors.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...