Shared publicly  - 
 
#CloudFoundry tip: use --skip-extended-insert with mysqldump when preparing a dump to import in a Cloud Foundry MySQL database through vmc tunnel

I tried importing my Wordpress blog database MySQL dump to Cloud Foundry using vmc tunnel.

mysqldump --opt generates extended insert statements, ie in my case, a 1.1 Mb one line statement inserting all blog posts into wp_posts. This is the right option for generating more compact backup files.
But when sourcing this sql dump from vmc tunnel, the tunnel connection breaks while executing this 1.1 Mb statement.
ERROR 2013 (HY000): Lost connection to MySQL server during query
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: xxx

Using mysqldump --opt --skip-extended-insert to generate the dump generates a slightly larger file (2.1 Mb instead of 1.8 Mb) but with single line statements for each record, which then gets processed flawlessly using vmc tunnel.
cf http://lists.mysql.com/mysql/208873

I guess similar tips apply to dumps of postgres or Mongodb as well, when you want to import data in a Cloud Foundry based service.

I hope this will help you import your data in Cloud Foundry.
In the last episode (Sep 03), Marten Lehmann said: > I couldn't find an option within mysql 5.0.x to get a dump of all > rows of a table with one line per row/record. I always get insert &gt...
4
2
Magizharasu Thirunavukkarasu's profile photoCloud Foundry's profile photoRobert Wallström's profile photo
 
vmc tunnel allows us to export dump and also to get to the mysql cmd line but how do we import ? if i  choose none nothing happens ! I thought I could give my commands there.
Add a comment...