Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a mysql broken database and I have another one which is good and with all tables and columns. How can I import in broken database only missing info which is in good database? I mean tables and columns and values not stored info.

I exported good database and when I try to import in broken database I get: #1060 - Duplicate column name 'id_advice'

So, what I need is to skip if duplicate items and continue to add only info which does not exist.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
163 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can make use of Mysqldump. There is a selection to use no data.

mysqldump -uYourUserName -p=YourPassword databasename --no-data --routines > "dump.sql"

The you can import the table stucture. there is also different options to use create if not exists or drop if exists so you can tailor make it for your needs. I recommend downloading Mysql Workbench, its easily done with that tool.

Info about mysqldump http://dev.mysql.com/doc/refman/5.6/en/mysqldump.html


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...