MySQL using Command Line on PC with XAMPP installed

With XAMPP when you have to import a very big mysql table, even though you have increase the script time in php.ini but sometimes it still does not cut the mustard. I found out another way to do this by going through the command line interface. For this example, I am going to use ms-dos in Microsoft Windows, however you can do similar thing with SSH.

  1. Navigate to your MySQL folder (by default it should be C:\xampp\mysql
  2. Run mysql.exe with this command: mysql -u userName -p.
  3. Once you are in MySQL interface, then type use dataBaseName. If the dataBase is not set yet, run this command: create database databaseName; Remember to always put this sign ; at the end of your command.
  4. After the new database created, type use databaseName;
  5. To import, type: source pathToSQLData. In PC, it will be something like source C:\xampp\htdocs\backup.sql
  6. It should start importing your data now.

Remember in the command line, you can do all sort of other things that you usually type in phpmyadmin sql section, it will be just faster and free of time limit if you use the command line interface.

Comments

Popular posts from this blog

Error code 8024001b (solved)

Enable PHP opcache extension on Windows XAMPP

Hiren can not load the CD ROM Driver