Insert .sql file into your MySQL database

44,590

Solution 1

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....

Solution 2

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/

Solution 3

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

Share:
44,590
user1916274
Author by

user1916274

Updated on July 16, 2022

Comments

  • user1916274
    user1916274 almost 2 years

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

    How can I upload a SQL file to the database?

    • John Conde
      John Conde over 11 years
      You could have found your answer in Google faster then typing your question here