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.
-
2You could Google "export mySQL" – Pekka Feb 17 '13 at 16:15
-
1See e.g. http://www.mydigitallife.info/how-to-backup-and-restore-export-and-import-mysql-databases-tutorial/ – Pekka Feb 17 '13 at 16:15
3 Answers
Exporting MySQL database from xampp
The command line :
- First of all open command prompt
- 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)

- 789
- 10
- 10
-
Export command works but import doesn't work. However answers the question. Thanks. – chamal101 May 31 '19 at 07:14
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

- 1,036
- 1
- 13
- 24
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.

- 5,379
- 9
- 43
- 67