8
Exporting a database to a sql script 1

Exporting a database to a sql script 1. Getting to the command-line in XAMPP. Go to All Programs/XAMPP/XAMPP Control Panel. Click on Shell. 2

Embed Size (px)

Citation preview

Page 1: Exporting a database to a sql script 1. Getting to the command-line in XAMPP. Go to All Programs/XAMPP/XAMPP Control Panel. Click on Shell. 2

Exporting a database to a sql script

1

Page 2: Exporting a database to a sql script 1. Getting to the command-line in XAMPP. Go to All Programs/XAMPP/XAMPP Control Panel. Click on Shell. 2

Getting to the command-line in XAMPP. Go to All Programs/XAMPP/XAMPP Control Panel. Click on Shell.

2

Page 3: Exporting a database to a sql script 1. Getting to the command-line in XAMPP. Go to All Programs/XAMPP/XAMPP Control Panel. Click on Shell. 2

Use the mysqldump command. I used the root user (-u). I did not enter a password (-p), but it prompted me for one. I named the database I wanted a script for. I directed the results into a .sql file

mysqldump -u root -p classicmodels > c:\xampp\classicScript.sql

3

Page 4: Exporting a database to a sql script 1. Getting to the command-line in XAMPP. Go to All Programs/XAMPP/XAMPP Control Panel. Click on Shell. 2

Prompted for password. Not much seen here since results directed to file.

4

Page 5: Exporting a database to a sql script 1. Getting to the command-line in XAMPP. Go to All Programs/XAMPP/XAMPP Control Panel. Click on Shell. 2

Right click on the C:\ icon to access the menu. Mark (highlight), copy, and paste are under Edit.

5

Page 6: Exporting a database to a sql script 1. Getting to the command-line in XAMPP. Go to All Programs/XAMPP/XAMPP Control Panel. Click on Shell. 2

In PHPMyAdmin, go to New on the left, enter a new database name and click Create

6

Page 7: Exporting a database to a sql script 1. Getting to the command-line in XAMPP. Go to All Programs/XAMPP/XAMPP Control Panel. Click on Shell. 2

Select new datadase on the left, go to the Import tab, choose the sql script you made by clicking on Choose File. Scroll down and click Go.

7

Page 8: Exporting a database to a sql script 1. Getting to the command-line in XAMPP. Go to All Programs/XAMPP/XAMPP Control Panel. Click on Shell. 2

Result of script. Tables created. Data inserted.

8