Page 1 of 1

Problems to Import a MYSQL file

Posted: Sat Jan 20, 2007 11:32 pm
by silverme
I was trying to load an old .sql file from the backup to read something deleted but had some trouble importing it.

Here's some info about the file:

File size: 17MB
MYSQL type database
-- phpMyAdmin SQL Dump
-- version 2.6.4-pl2
-- Host: localhost
-- Generation Time: Apr 21, 2006 at 09:36 PM
-- Server version: 4.1.18
-- PHP Version: 4.3.11


Here's some info about the server:

phpMyAdmin 2.6.3-1
MySQL 5.0.19-nt running on localhost as root@localhost
PHP Version 5.1.0


I tried to import the file with phpMyAdmin but it didn't work. I think it's because it has a 2MB maximum limit.

Then I went to the DOS console to use mysql but got an error.

c:\usr\local\mysql5\bin>mysql -u root -p database_name<tables.sql
Enter password: *******
ERROR 1406 (22001) at line 210: Data too long for column 'attachurl' at row 1


What should I do to import the .sql file?


Thank you

Re: Problems to Import a MYSQL file

Posted: Sun Jan 21, 2007 2:19 am
by volka
silverme wrote:ERROR 1406 (22001) at line 210: Data too long for column 'attachurl' at row 1
Your table has a field attachurl and at least one INSERT operation tries to put too much data into it.

Posted: Sun Jan 21, 2007 10:59 am
by silverme
What should I do to fix the problem? I'm trying to load all the tables from the backup to an empty database.

Thanks

Posted: Sun Jan 21, 2007 6:02 pm
by iknownothing
silverme wrote:What should I do to fix the problem? I'm trying to load all the tables from the backup to an empty database.

Thanks
check your attachurl attributes. Change to "text" or something similar perhaps...

Posted: Mon Jan 22, 2007 11:55 am
by rami
NORMally phpmyadmin puts some kind of size restriction while uploading and downloadig the file..especially downloading...
so how to do that ...suppose my one table is 10mb how to download it using phpmyadmin..

Posted: Mon Jan 22, 2007 2:36 pm
by pickle
At this point, you've probably got the database & tables created (due to those queries in the dump file being executed). Do you know if the dump file included table creation statements? If yes, then drop the database & edit the dump file - changing the offending column type to text or larger. If no, then do what ~iknownothing suggested & change the table definition in mysql. Drop the data, then re-import the file.