When you are Host your website on Hosting Server from your Local server at that Time a Error Mostly Occur “#1044 – Access Denied for user ‘user_name’@’localhost’ to database ‘Database_name ” While you are Dealing with Database. because in Local server Like WAMPSERVER you can create Database of any Name but while Uploading Database on Hosting Server you have no choice to Create Database of any Name. you can create Database which name is Prefixed by any User Id or login id such as ‘ u5421542568_database ‘. Below is a Trick to Import Database on Hosting Server and solve #1044 Mysql Error.
Step 1 : Export Database From your WAMPSERVER (localhost).
suppose that Name of Database which you Export is test .
Step 2 : Login into your Website CPannel.
Step 3 : In Advanced Category >> click on MySQL Databases .
A new window will open where you can Create a new MySQL Database And Database user.
Step 4 : Name the MySQL Database and username as well as Password.
Step 5 : Login into PhpMyAdmin of database you Created. Here I am use u849442442_test .
Step 6 : Open Database file Which you Exported earlier from your local WAMPSERVER with Editor of your Choice.
Step 7 : Replace local WAMPSERVER database Name with Hosting Server Database Name and Save It.
like.. Replace test with u849442442_test .
Step 8 : Import Database.sql file (a file which we update) into your PhpMyAdmin of Hosting Server.
Enjoy…. If you Have Any Question comment Here.