0

I've acquired a back-up file of my company database in the form of a self contained .sql file. I've set up MYSQL on my Win7 box and am trying to import the data into a schema with the same name as guided by MYSQL help files. It does load some data however not all of it is being imported and I get the following in the Import Progress window of the MySQL Workbench:

10:11:15 Restoring C:\Backup\DB798-2016-Feb-07.sql
Running: mysql.exe --defaults-file="c:\temp\tmp4g_coc.cnf"  --protocol=tcp --host=localhost --user=root --port=3306 --default-character-set=utf8 --comments --database=DB798  < "C:\\Backup\\DB798-2016-Feb-07.sql"
ERROR 1265 (01000) at line 11251: Data truncated for column 'social_network' at row 1

Operation failed with exitcode 1
10:12:25 Import of C:\Backup\DB798-2016-Feb-07.sql has finished with 1 errors

I don't care about the data in any table labeled 'social_network' the data I really need is somewhere after that in the import process. Any way I can skip that?

1 Answers1

0

It is being truncated because the column in the table is set to a VARCHAR(integer). if the integer there is shorter than the text you are importing, it will get truncated.

You either need to increase the length of the varchar, or shorten your text before import.

durbnpoisn
  • 4,666
  • 2
  • 16
  • 30
  • How would I go about doing that? I can't open the file with anything to get at the data. – T. Griffith Feb 11 '16 at 16:48
  • If you cannot edit the incoming data, then increase the size of the varchar field in the database. – durbnpoisn Feb 11 '16 at 17:16
  • Unless that file is absolutely enormous, you should be able to open it in a text editor. I don't know why you're having trouble with that. – durbnpoisn Feb 11 '16 at 17:17
  • Also it doesn't show that column in the created schema. So it's like it's not adding it when it recreates it from the import. – T. Griffith Feb 11 '16 at 17:58
  • I don't understand how the column is generating an error, yet it has not been created? That doesn't make any sense. – durbnpoisn Feb 11 '16 at 18:12