Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialqdzfplofsk
22,025 PointsShould each database have a connection and schema?
I want to have one database to keep and one to test with. Just trying to figure out the best practices. Should I do this for each database:
- New mysql connection
- New database schema
- Input data into database using statements etc.
OR
- Create one mysql connection
- Create new database1 (or rather schema?)
- Import database2.sql (schema is part of .sql file)
- Keep adding schemas/databases and have them all show up in the schema tab all using a single mysql connection
I also realized that if you delete the same schema used by two databases it basically removes all data from both and you are left with no schema and empty databases (opps).
NOTE: I am using mySQL Workbench 6.1 on osx which looks different than video version
2 Answers
William O'Dell
8,831 PointsWhat I usually do is have at least two environments setup.
- My production server with its own schema, Production Environment
- My local box with is own schema, Development Environment
If you are going to have a big test suite to run against your code, it could be a good idea to make a second schema on your own box to run the tests against.
qdzfplofsk
22,025 Pointsthanks william thats helpful. i wasn't sure how the models came into play with that local/production setup.
qdzfplofsk
22,025 Pointsqdzfplofsk
22,025 PointsI tend to think multiple connections is the way to go based of mysql workbench docs.