I got a new laptop and want to move my entire development environment, as is, to my new machine
Everything was incredibly easy, except for the MySQL database, which is turning out to be a complete nightmare. Eventually, I copied it to my new machine and got it set up, using the following:
mysqldump -u root -p tillyoudrop_dev > tillyoudrop_dev.sql
mysql -u root -p tillyoudrop_dev < tillyoudrop.sql
But when I enter the rails console, I find that only the tables seem to have copied, but no data...
For example , when I enter User I get
2.0.0-p451 :003 > User
=> User(id: integer, email: string, encrypted_password: string, reset_password_token: string, reset_password_sent_at: datetime, remember_created_at: datetime, sign_in_count: integer, current_sign_in_at: datetime, last_sign_in_at: datetime, current_sign_in_ip: string, last_sign_in_ip: string, created_at: datetime, updated_at: datetime, cart_id: integer, superadmin: boolean, invitation_token: string, invitation_sent_at: datetime, invitation_accepted_at: datetime, invitation_limit: integer, invited_by_id: integer, invited_by_type: string)
2.0.0-p451 :004 >
which is the desired, correct behaviour, but when I look for entries:
2.0.0-p451 :004 > User.count
(0.3ms) SELECT COUNT(*) FROM `users`
=> 0
2.0.0-p451 :005 >
There are none. How do I copy the actual data from my old dev environment to my new one?
usersVALUES (5,'[email protected]','$2a$10$mz5YC.Rqp9HMf2KWWSY9QeJMrQI81lLXhMzPkkEzJS3ecsRLE9Fgy',NULL,NULL,'2013-10-17 10:22:00',44,'2013-10-29 09:23:21','2013-10-29 08:27:22','105.237.17.170','105.237.17.170','2013-07-30 14:13:57','2013-10-29 09:23:21',NULL,0,NULL,NULL,NULL,NULL,NULL,NULL),(6,'[email protected]','$2a$10$eukJZMxjRJZFcsk.ruPNHeapRZRQ082wtCgug1xeRnuKNMGYz5ScO',NULL,NULL,NULL,1,'2013-07-30 15:28:53','2013-07-30 15:28:53','196.215.97.51','196.215.97.51','2013-07-30 14:13:57','2013-07-30 15:28:53',NULL,0,NULL,NULL,NULL,NULL,NULL ...mysqldirectly, and doselect count(*) from usersdo you see the data? Also, can you run your application on your new machine?testandinformation_schema. Information schema saysERROR 1109 (42S02): Unknown table 'users' in information_schemaand test saysERROR 1146 (42S02): Table 'test.users' doesn't existcreate database tillyoudrop_devbefore you try to import the schema and data.