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
Problems to Import a MYSQL file
Moderator: General Moderators
Re: Problems to Import a MYSQL file
Your table has a field attachurl and at least one INSERT operation tries to put too much data into it.silverme wrote:ERROR 1406 (22001) at line 210: Data too long for column 'attachurl' at row 1
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.