Import large databases into xampp

Large databases cannot be imported because of the limited scipt execution time. This is signaled, for example, by the message: Maximum execution time exceeded. You can increase the maximum execution time via php.ini: This is often sufficient for somewhat larger databases.

Change php.ini under xampp

  • xampp/php/php.ini
  • Search for “max_execution_time” in php.ini
  • You can find this setting “max_execution_time = 30” The 30 stands for 30 seconds. Simply increase, e.g. 300 seconds for 5 minutes

For really large databases, this is often not enough. The time factor of the import should also not be underestimated.

Import via the console from xampp

  • Open console: start xampp-control.exe. If it is not already started – just switch to the xampp console.
  • Use the “Shell” button to start the command prompt. Now you have to log in with your database user and password
  • Now enter “mysql -u root -p”. “-u” stands for the user, “root” is the username, “-p” stands for the password. Replace “root” with your username. Then click on “Enter”.
  • Now the prompt to enter the password appears. Enter your password here. If you use the default user “root”, you don’t have to enter a password here.
  • Select the database to which you want to import your data. Type the following command: “use my-database; – Replace the word “database” with your desired database name. Press “Enter”. The successful selection of the database is acknowledged with the message “”Database changed”.
  • Now the actual import takes place. With the command: “source C:\hier\path\mysql-file.sql”. the desired file is located on the computer and with “Enter” the import process is started. Replace the path with your path – and of course use the backslash (AlrGr + ß) to specify the path 😉

Honestly? I was really happy the first time I did this process that it worked. The problem lies in the details. A typo here or there, and the operation is not performed. For some of you, the step over the console is a huge one. My tip is to take your time and be patient with yourself. And if it does not work, check letter by letter!