It seems pretty easy, however you may probably don't know from where you need to execute the previous command, isn't ? With windows there are 2 ways to do it: A. That with some real values, should look like (importing the ourcodeworld.sql database located in the desktop into the ourcodeworld database): mysql -u root -p ourcodeworld < "C:\Users\sdkca\Desktop\ourcodeworld.sql"Īfter the execution of the commands with the required values, the console will prompt for the password (that you should let empty in case there isn't any and just press Enter) and will start importing the database. For example, to import a database we just need to execute the following command with the following arguments: mysql -u < "path/to/file/database-to-import.sql" ![]() Using mysql from the command line interface is very easy. Import the database with the command prompt Open the xampp folder and search for the executable inside the mysql/bin folder, in this example the executable will be located in the E:\Programs\xampp\mysql\bin folder:Ĭopy the path in the clipboard as you will need it in the next step. The output format can be changed using command options.įor our task, that is importing the database with the command line, this will be the required tool, therefore the first you need to do is to locate the executable of mysql in your xampp distribution. ![]() When used noninteractively (for example, as a filter), the result is presented in tab-separated format. When used interactively, query results are presented in an ASCII-table format. It supports interactive and noninteractive use. The mysql executable is a simple SQL shell with input line editing capabilities. In this article you will learn how to import a mysql database with the command prompt in XAMPP for Windows. This in turn, isn't a big limitation as you can increase the allowed filesize of the database however it will take time to configure it and it won't be so fast as with the command line (at less for people with a database of more than 100MB). One of the most known reasons, in this case is the task of import a database, because as everybody knows there's a limitation with the filesize of a database with phpmyadmin (Max: 2,048KiB with the default configuration of xampp). Besides it isn't fancy, however there are a lot of reasons why some people prefer the command line instead of an UI. If you found this tutorial helpful then don't forget to share.There are a lot of developers who claim that visual editors (like in this case to import the database phpmyadmin) are not as trustworthy as the command line. With Command-Line you can also import SQL file in your MySQL database. The SQL file stored in xampp/mysql/bin/ folder if you have used the command line. You can either export your MySQL database using phpMyAdmin or Command-Line.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |