Hi, whenever I try to export a table from MySQL it truncates the data in some of the fields. It doesn't matter if I try to export it to .csv or excel it still truncates. does this have to do with .csv or excel or just the way I set up my tables.

Also how can I mitigate this?

Thanks,

    What column type is being truncated?

    Are you sure the data wasn't truncated when it was INSERT'ed? That is, can you SELECT the data manually (via CLI, phpMyAdmin, ...) and see all of it?

      Brad, yeah it definetly is being truncated ONLY on exporting. tested it again several times. When it is imported I can see the data with PHPadmin and it maintains its integrity in the database.

      Weirdly it seems to truncate number fields that start with zero. FYI, these fields in the table are of type VARCHAR. I don't know if this matters.

        How are you exporting the data?

        EDIT: After re-reading your first post above, I'm guessing you've only tried doing the exporting through phpMyAdmin? If so, do you have access to a shell/CLI interface? You should try exporting using the mysqldump utility and see if the data shows up as expected; it's possible that you're experiencing a bug with phpMyAdmin.

        Which version of MySQL and phpMyAdmin are you using? Also, can you show us the schema of the table (e.g. do a 'SHOW CREATE TABLE tbl_name') you're having problems with?

          bradgrafelman;10985548 wrote:

          How are you exporting the data?

          EDIT: After re-reading your first post above, I'm guessing you've only tried doing the exporting through phpMyAdmin? If so, do you have access to a shell/CLI interface? You should try exporting using the mysqldump utility and see if the data shows up as expected; it's possible that you're experiencing a bug with phpMyAdmin.

          Which version of MySQL and phpMyAdmin are you using? Also, can you show us the schema of the table (e.g. do a 'SHOW CREATE TABLE tbl_name') you're having problems with?

          Yeah, that's correct. Only through phpMyAdmin.

          I do have access to a shell and I will try using the mysqldump utility and see what happens.

          mySQL v5.0.92-community, php v5.2.11 and phpMyAdmin v.3.3.10.2

          I can't really show you the schema - I'm assuming that means the structure - but i can tell you it has 20 fields all of them are of VARCHAR type for now. does that help?

            c/tcp/ip;10985549 wrote:

            phpMyAdmin v.3.3.10.2

            Any chance you could try using the latest stable version of the 3.4.x branch (currently 3.4.3.2)? If this is somehow caused by a bug in phpMyAdmin, the devs will likely ask you to upgrade and see if the problem goes away, so you might as well give that a shot first.

            c/tcp/ip;10985549 wrote:

            i can tell you it has 20 fields all of them are of VARCHAR type for now. does that help?

            Eh... not really. :p I was going to try to mirror the same setup you're working with and see if I could reproduce the truncation problem.

            If all else fails, perhaps you could try opening a bug report for phpMyAdmin (after grabbing the latest version, of course)?

              sorry, I don't think I can use another version. the db is on a shared hosting site. I will contact the admins and see if maybe someone else may have reported something similiar.

              Once again, Thank you so much for your help. And if you think of anything else I may be doing wrong please let me know.

                c/tcp/ip;10985549 wrote:

                I can't really show you the schema - I'm assuming that means the structure

                If you have select privileges to the db, you will most likely also have SHOW privileges

                SHOW CREATE TABLE tablename
                
                  Write a Reply...