Dear all
My name is Sarfaraz. I have created a small website for learning purpose only.
I have developed it in PHP and Mysql. The site is working fine on local server with My sql database. The sign up, Login pages are working just fine.
But when i am uploading the site on my hosting server all pages are working but pages having MYsql connectivity is displaying errors.
The actual Error is
Warning: mysql_connect() [function.mysql-connect]: Access denied for user ''root''@''localhost'' (using password: NO) in /home/jahanina/public_html/sign_up.php on line 48
Access denied for user ''root''@''localhost'' (using password: NO)
Actually I need the correct method to use username/ passsword and database in PHp and Mysql on hosting server.
Thank you
Sarfaraz
解决方案Typically you will not be able to use "root" as the login user for your site neither web.
If the server is placed in another company typically they will want to control their computer and be able to do maintenance tasks there.
Speak with your hosting company, they will give you the username and password you need to use for the database or how to change it.
If you''ve uploaded the database structure and data into your remote server you should have the username and password for it. Use those connection details and try it again.
Good luck.
after you hosted you will get username and password from hosting company you should use that for your server page where you written your database connectivity code and you should must have some password
Goto Mysql database in your cpanel.
Create database
add anew user and password
add user to database
Give privileges to the user
Make changes
Now open your php page where the database connectivity is then replace username and password with the username and password you created in cpanel.
Type name of database as you created e.g yourhost_abc.
Now test your page it will work just fine.
Good luck
Sarfaraz