Search code examples
phpsqldatabaseimporteasyphp

I can't import an SQL database into EasyPHP


Absolute beginner to programming here. I made an SQL based database on a program called EasyPHP on one PC and I exported it(file extension:'.sql'). I downloaded EasyPHP onto my PC, different from the one I made the database in, and I tried to import the database I made earlier however, I'm getting an 'Error 1046: No database selected'. I really don't understand how this is happening. I checked the database in Notepad and it seems fine - I have my data fields defined and all my records are intact.

Any help would be appreciated.


Solution

  • The import doesn't create the database for you. So, you need to create a new database first, then click into it, then do the import.

    If the EasyPHP on your new computer doesn't have a database in it already the import has nothing to import into. This has thrown me a few times as well. When doing an export and then a subsequent import, a database isn't created for you.

    Depending on your PHPMyAdmin version, you're likely to see a Databases tab up the top. Click it. You should then be able to choose a database name, then click Create Database. The new database should now appear in the list on the left. Click it, then you can go to the Import tab and import your .sql file.