From the course: Learning phpMyAdmin

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Importing data from a SQL dump file

Importing data from a SQL dump file

From the course: Learning phpMyAdmin

Start my 1-month free trial

Importing data from a SQL dump file

- The most common way to load data into MySQL is by using an SQL file, which is basically a text file containing a series of SQL queries. In the exercise files in the Chapter 4, 04_03 folder, is a file called cars.sql . Let's take a look inside this file. I'm going to open it in brackets with any text editor will do. This contains all the necessary commands to define an individual table and populate it with data. But the technique that this uses is exactly the same for loading data into multiple tables, a whole database, or even into multiple databases. In effect, it's the way that you transfer data from one server to another or to restore a database from a backup. Each line that begins with a double dash is a comment, so at the top it's saying it's a phpMyAdmin SQL Dump, the version that was used to create it when it was created, and so on. And if we scroll down a little bit, on line 20 it says Database: `up_and_running` but this is also a comment, so that means that although it was…

Contents