user1916274
user1916274

Reputation: 51

Insert .sql file into your MySQL database

I have installed XAMPP. In this I made a database via PhpMyadmin.

How can I upload a SQL file to the database?

Upvotes: 3

Views: 45065

Answers (4)

Benabra
Benabra

Reputation: 309

In your mysql console you have to type this command :

mysql> use YourDataBaseName
mysql> source YourFile.sql

or in your console type :

mysql -u root -p [YourPassword] [YourDataBaseName < YourFile.sql

For more information you can visit: http://www.cyberciti.biz/faq/import-mysql-dumpfile-sql-datafile-into-my-database/

Upvotes: 6

Basith
Basith

Reputation: 1075

Follow the setps to upload your sql file to database.

  1. Run this link from your browser http://localhost/phpmyadmin.
  2. Select Database which you want to upload the SQL file. (If no DB , create new database).
  3. Click on Import option from top menu section and upload you files.

Please check the screenshots for your reference.

enter image description here enter image description here Try It... This will helps you....

Upvotes: 10

AgeDeO
AgeDeO

Reputation: 3157

In phpmyadmin choose import in the top menu and open your sql file from that page

Upvotes: 1

Related Questions