Mysql Xampp Cmd

Get code examples like 'xampp mysql cmd' instantly right from your google search results with the Grepper Chrome Extension. May 08, 2019 XAMPP MySQL as a package XAMPP is a cross-platform compatible Apache distribution. Likewise, MySQL perfectly works on multiple operating systems and it can easily integrate with PHP. On XAMPP MySQL works as a database component which is required to run a database-enabled website and servers.

Taking the backup of the database is necessary whether it small or large projects. You can easily revert the database if something went wrong.

Mysql xampp command prompt

Using phpMyAdmin you can easily export your MySQL database but it got cancel if it exceeds the max defined time.

You can also Command-Line to export selected MySQL database.

In this tutorial, I am using XAMPP in windows. Eclipse latest version for mac downloads.


1. Export Database

  • I am exporting tutorial database using Command-Line.
  • For this open Command Prompt.
  • Navigate to xampp/mysql/bin directory.
  • Execute the following command –

Syntax –

username – MySQL username.

database-name – Database name which you want to export.

export-file-name.sql – Specify you export file name.

Example –

Here, I am exporting tutorial database and set export file name – tutorial.sql.

It will ask for a password.

Enter the user password if you have defined otherwise press enter.

A new SQL file will create in the xampp/mysql/bin/ directory.

2. Conclusion

You can either export your MySQL database using phpMyAdmin or Command-Line.

The SQL file stored in xampp/mysql/bin/ directory if you have used the command line.

With Command-Line you can also import SQL file in your MySQL database.

If you found this tutorial helpful then don't forget to share.

Related posts:

  • 8

As we all know the xampp is most popular tool at machine level programming work, but sometime we need to deal with the bigger databases to import into mysql of xampp that provide and we import that using user interface then we will fail or not properly imported, I personally faced that issue many times so I just use the command prompt, because it is fastest way to do any task in any any operating systems.

For Importing database using xampp mysql, just follow the simple steps below, its quiet easy to do -

1) First, open the command prompt of windows using WIN+R key, and write CMD on RUN to open it, or you can use anyway you want.

2) Now you need to know where your xampp installed, For my case its on D:xampp Directory of windows

Mysql Xampp Cmd

3) Now navigate to 'D:xamppmysqlbin>' Folder and login using root use like this:

Xampp Windows 10

mysql -u root -p

it will ask for that password, so hit enter again and you will see the mysql prompt like below image

Now if you want create database, create by using command

Xampp Connect To Mysql


to show all list of databases, use that command


it will bring up list of all databases, now you select one database you want to import using

USE my_db;

output: database changed

now database it selected, import using source command

SOURCE ./path/to/sqlfile/my_db.sql;

once process completed database is imported. Now you can use it however you want.

Xampp Mysql Connect Cmd

Add new comment