Exporting MySQL database from XAMPP [closed]

心已入冬 提交于 2019-12-03 15:24:46

问题


I need to send my website with the MySQL database. I have done the website and MySQL database in XAMPP but don’t know how to send the database.


回答1:


You have 2 possible ways to do that

  • by command line

backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql

  • or use phpmyadmin (usually installed with XAMP), or something like that and export it from browser



回答2:


Exporting MySQL database from xampp

The command line :

  1. First of all open command prompt
  2. Syntax:-

Import Database :- D:/xampp/mysql/bin/mysql – u root -p databasename < D:/test.sql (sql file name)

Export Database :- D:/xampp/mysql/bin/mysqldump -u root -p databasename > D:/text.sql(sql file name)




回答3:


MySQL ships with mysqldump, and so does XAMPP. It’s used for dumping data in SQL format, and its easiest appliance might be dumping all databases into one SQL dump file, executing it incmd.exe:

mysqldump --all-databases > dump.sql

For XAMPP, you need to provide the username(-u root)as well as a database name(test):

mysqldump -u=root test > xampp-test-db.sql

As a practical, verbose example:

D:\xampp\mysql\bin> mysqldump.exe --user=root --password=pwd myDatabase > C:\myBackup.sql

Note thatmysqldump has extensive, powerful options for a wide variety of backup applications.

Since it generates SQL scripts, recovery is easy; see Reloading SQL-Format Backups.



来源:https://stackoverflow.com/questions/14923150/exporting-mysql-database-from-xampp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!