newguy
05-14-2009, 01:28 AM
I have been accustom to using one database user for multiple databases. When I try to do this with bluehost I get such an error...
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'bhaccount_dbname'@'localhost' (using password: YES) in /home/bhaccount/public_html/index2.php on line 24
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/bhaccount/public_html/index2.php on line 25
The fix was to create multiple database users and to give one user to database. If my website requires multiple connections to a single database by multiple scripts, each script needs to have its own user name.
I suppose their is a reason for this. Could one please enlighten me?
Hopefully this helps someone else if they run into this same issue.
Thank You!
*I just wish I knew about this sooner. It took a good while to debug this issue.*
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'bhaccount_dbname'@'localhost' (using password: YES) in /home/bhaccount/public_html/index2.php on line 24
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/bhaccount/public_html/index2.php on line 25
The fix was to create multiple database users and to give one user to database. If my website requires multiple connections to a single database by multiple scripts, each script needs to have its own user name.
I suppose their is a reason for this. Could one please enlighten me?
Hopefully this helps someone else if they run into this same issue.
Thank You!
*I just wish I knew about this sooner. It took a good while to debug this issue.*