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 tr
Must Ensure that your User_Name, Password and Database name are correct. If you are Deal with database 'sampled' then type 'sampled' in query instead of 'db' also must ensure that you don't have to use quota(') in Statement. For More and Accurate Detail visit Following link: http://onephin.com/1044-access-denied-user-user_namelocalhost-database-database_name/
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.
Export and import just tables of the database:
-> open the database in phpmyadmin
-> click to export
-> save the file (you don't have to change any settings)
-> open the database on new server
-> click to import
-> chose the file
-> click to "GO" and you are done...
It was working for me :-)