Nicholas Posted August 4, 2009 Posted August 4, 2009 hi i get a warning message on some files that probably use mysql Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'mysql_host' (1) in /home/nicholas/public_html/mysql.php on line 2 Unknown MySQL server host 'mysql_host' (1) <? $c=mysql_connect('mysql_host','mysql_user','mysql_pass') or die(mysql_error()); mysql_select_db('mysql_db',$c); ?> can anyone help me find the problem? Quote
Nicholas Posted August 4, 2009 Author Posted August 4, 2009 Re: mysql help? also if anyone can give me there mysql.php file information that would be greatful. Quote
Haunted Dawg Posted August 4, 2009 Posted August 4, 2009 Re: mysql help? <? $c=mysql_connect('localhost','cpanelusername','cpanelpassword') or die(mysql_error()); mysql_select_db('cpanelusername_database',$c); ?> Doubt anyone is going to give you their file information lol. Quote
Nicholas Posted August 4, 2009 Author Posted August 4, 2009 Re: mysql help? Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'cpanelusername'@'localhost' (using password: YES) in /home/nicholas/public_html/mysql.php on line 2 Access denied for user 'cpanelusername'@'localhost' (using password: YES) i get that now lol, this mysql.php file is kinda getting annoying lol. all my other files are good apart from this stupid mysql.php file lol also u never know if they would, they might be kind and let me use it lol, they could also tell me it in a private message. Quote
Feky Posted August 4, 2009 Posted August 4, 2009 Re: mysql help? cpanelusername_database cpanelusername cpanelpassword replace these with your details Quote
Spudinski Posted August 4, 2009 Posted August 4, 2009 Re: mysql help? Your username and password combination is a unique value, therefor you cannot use some-one elses. You should ask your hosting provider's support center to set them up for you, or you should Google a few PHP & MySQL tutorials and learn how to do it by yourself. Quote
Nicholas Posted August 5, 2009 Author Posted August 5, 2009 Re: mysql help? <? $c=mysql_connect('mysql_host','mysql_user','mysql_pass') or die(mysql_error()); mysql_select_db('mysql_db',$c); ?> what so for example say my hostname is = localhost database name is = **** username is = **** password i set was = **** it should turn out like this? <? $c=mysql_connect('localhost','****','****') or die(mysql_error()); mysql_select_db('***',$c); ?> Details Removed - Spudinski Quote
Feky Posted August 5, 2009 Posted August 5, 2009 Re: mysql help? lol you just gave away all you cpanel details Quote
Jordan Palmer Posted August 5, 2009 Posted August 5, 2009 Re: mysql help? lol you just gave away all you cpanel details Maybe he didn't maybe he just filled it in :-o Quote
Feky Posted August 5, 2009 Posted August 5, 2009 Re: mysql help? lol you just gave away all you cpanel details Maybe he didn't maybe he just filled it in :-o if he just filled it in then thats good but if not i would advise him to change his details because alot of people would try to steal your files/delete them Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.