26

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.

dakab
  • 5,379
  • 9
  • 43
  • 67
199user911
  • 405
  • 2
  • 6
  • 10

3 Answers3

28

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)

Pritam Chaudhari
  • 789
  • 10
  • 10
18

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

dakab
  • 5,379
  • 9
  • 43
  • 67