Forum Moderators: open

Message Too Old, No Replies

Making a new database from the .sql file

Please help me get started

         

spietreser

4:58 pm on May 27, 2006 (gmt 0)

10+ Year Member



Recently I bought a MySQL database with wich I will develop a website. Since this will be my first website with a database I was hoping you could point me in the right direction.

The database I bought is a file with the .sql extension. Using phpMyAdmin I can create a new MySQL database with tables. However, I have no idea (and have not found any info on this in the search engines) how to import the data from the .sql file to the database.

Any help would be greatly appreciated!

Thanks in advance.

txbakers

9:19 pm on May 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Essentially, all you need to do is run the SQL file against the command line and it will execute the statements in the .sql file.

I don't know how to do it with phpmyAdmin, but someone here does.

I always do it from the command line:

mysql -u root -p < d:\backupfile.sql

which will read and execute the file called backupfile.sql

wheelie34

7:22 am on May 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



While in phpmyadmin, on the SQL page, theres a text area to run a command, below the text area is a browse button to locate and upload a db file, make sure the file has the structure of the database at the top so it actually creates the tables before inserting the data, its as easy as that.

spietreser

1:32 pm on Jun 3, 2006 (gmt 0)

10+ Year Member



Thanks all for your answers. I now know how to add the .sql file to the database. However, the size of the file that I can add through phpMyAdmin is limited to 2mb. The file I need to add is about 100mb.

How can I remove this limitation to I can add any size of .sql file to the database?

Thanks in advance :o)