I have recently purchased web hosting service at godaddy. I have already completed my project and i used xampp. Now i want to import the database which i arleady have. I tried to do it in the normal way by clicking on import and choosing the file. But i'm getting this error
How can I fix this?
Many web hosts only give you access to one database. Your SQL file is trying to create a new database (with a line near the top like CREATE DATABASE `socialnew`...
as you see in the error message).
The likely solution is to not create the database from your script. You can either edit the .sql file manually and remove the lines starting with CREATE DATABASE `socialnew`...
and USE `socialnew`;
, or, if your phpMyAdmin is pretty up-to-date, you could do the export again from your XAMPP and make sure the checkbox is not selected for "Add CREATE DATABASE / USE statement".
Then when doing the import, make sure you're selecting the Import tab from within the database you wish to import to.
You may also open the .sql file in an IDE and just delete the create command.Then, assuming you've navigated to the desired DB import section in phpMyAdmin, you can run the import with the modified file and you should be good to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With