MySQL Workbench Saving Database - mysql

I'm working on a group project and my partner sent me a .mwb file so I could take a look at what they did for the ER diagram, but she can't figure out how to send a .sql file for the database itself (at least I think those are .sql files). How do you save and send a database to someone? I am trying to test the database by writing some queries, but I don't know how to do that if all I can look at is the Diagram. Thanks for any help.

MySQL work bench can definitely do this for you.
here is one link where you have some screenshots too : Back up and restore MySQL databases using MySQL Workbench
It shows how to do both export and import of a database backup.

Related

Best approach to working with multiple developers and databases

I've been working on a project for a couple of months now with a few other developers and it has got to the point where we all have different changes to the DB we are working with, but all of the changes are local, meaning the server is out of sync with all of our local changes.
What is the best way to handle this? At the moment I tried to basically export my database from my local PC with phpMyAdmin and import that .sql file into the database on the server but as some of the tables already exist on the server it just gives out an error...
Would I have broken my database on the server by trying to import that sql file?
What do I do?
Ok so here's what I would do in your position...
Use this tool: http://www.clevercomponents.com/downloads/dbc/dbcdownload.asp
With the database compare tool, it should identify the differences in structure between two databases.
This generates an SQL file which will alter the target (your server) database to match the master (your local).
Always backup your target database before attempting something like this, just in case it goes wrong.

data lost in mysql workbench

I have imported data into tables in mysql workbench. And I have clicked apply and saved it. But when I shut down my laptop, all of the data has disappeared. my data lost. What should I do to solve it?
maybe it was because of this
thank you
This happens when are conflicts because you used the options:
Include Model...
or
Import > Reverse Engineer MYSQL Create Script...
The only solution is to make EER Diagram again.

No tables found in database

I have copied a database from another computer and pasted it in C>XAMPP>MySql>Data of my computer so that I can work with the tables of the database. But I cannot see the tables inside the database. Message shows 'No tables found in database'
I am using phpmyadmin 127.0.0.1 downloaded free from web. I am just a beginner in this field. Please excuse my ignorance and help me in this regard.
If you have your_db.sql file import the database and tables into MySql server using phpmyadmin. You can check here
The approach guaranteed is to Export from the source computer and Import to the destination computer; that is guaranteed and will work perfectly. Try that!
Do this from your phpmyadmin

How to recover a particular database from MySQL dump file?

I was having a website at a hosting while taking the backup I took the backup of whole mysql by mistake which includes databases of all my other websites also.
So now the problem is I want to extract that particular database from complete sql file?
Is there any procedure to do it or can we import that complete dump file into a mysql. So that later I can export that particular database after importing it to MySQL.
Please help me or suggest me how to do it.
Thank You.
http://fragments.turtlemeat.com/mysql-database-backup-restore-phpmyadmin.php
This should help.
If the size of the schemas in your backup file that you do not want to restore are not that big and there aren't that many other schemas in there, your best bet would probably be to just restore the entire backup and then do a backup of just your schema. One easy way to backup just your schema is to use MySQL Workbench. If you run into problems getting setup or doing the backup you might want to check this little write up that walks you through installation and performing a backup.

How do I move data in my production server to a database on my test server : MYSQL

I have data in a table A on my prod server. I want to move the data in it into table A (same name) on my test server.
What is the simple way to do this without exporting the data into some file and then inserting into my test table?
Thanks. I Looked around S/O and couldnt find a satisfactory answer.
If you have a tool like SqlYog, it's pretty simple with a couple of clicks of the mouse, otherwise you cannot do it because a query works in the context of a db connection, and for different servers you need different connections.
If you have phpmyadmin installed on both servers do the follwing
go to the table in phpmyadmin on your prod server
click export and export as .sql
go to the table in phpmyadmin on your test server
click import and upload the .sql file
If your database is more than 8 mb you can always compress it