Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export MySQL schema with data?

Tags:

mysql

I have a complete schema with many tables with data in them in MySQL query browser. Now I want to send this complete database with all the tables/data to my colleague. How can I send this to my colleague, so that he can then place this complete schema in his MySQL Query browser?

Thanks.

like image 844
junaidp Avatar asked Nov 26 '12 14:11

junaidp


2 Answers

I`m not sure where are you working, you could export it to file, and send it to your friend. (root is my localhost username)

mysqldump -u root -p --databases DB_NAME >databasename.sql 

PS: mysqldump is actually a executable file present in your /MySQL\MySQL Server 5.6\bin

for example [ on windows ]

C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin\mysqldump.exe 

or [ on linux ]

/usr/bin/mysqldump 
like image 195
Goran Usljebrka Avatar answered Oct 07 '22 16:10

Goran Usljebrka


You can use the mysqldump command.

If you are using MySQL Workbench open the server administration tab and you can do an Export To Disk from there using a GUI interface.

There are options to dump to a single file or directory, and whether to include data or not.

like image 31
Malkus Avatar answered Oct 07 '22 16:10

Malkus