How to export MySQL schema with data?

后端 未结 3 2023
臣服心动
臣服心动 2021-02-02 07:49

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

相关标签:
3条回答
  • 2021-02-02 08:36

    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.

    0 讨论(0)
  • 2021-02-02 08:46

    you could export the database as a *.sql file using phpMyAdmin.

    or write a C++/C#/Java etc Programm that generates such statements too.

    http://fragments.turtlemeat.com/mysql-database-backup-restore-phpmyadmin.php

    I am no way affiliated with turtlemeat

    0 讨论(0)
  • 2021-02-02 08:49

    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
    
    0 讨论(0)
提交回复
热议问题