powerpower1 Posted June 11, 2007 Share Posted June 11, 2007 my script is not connecting to my database, i get this error Warning: mysql() [function.mysql]: Access denied for user 'apache'@'localhost' (using password: NO) when i installed the script it did build the info in the database, but its not connecting to it when you run the script......please keep in mined that the script is encoded, so i cant change the code, this script works perfect on other peoples websites, im just the only one having a problem, but why is it going to use 'apache'@'localhost' .....it should use root.....any idea how to fix it ? Quote Link to comment Share on other sites More sharing options...
trq Posted June 11, 2007 Share Posted June 11, 2007 but why is it going to use 'apache'@'localhost' .....it should use root.....any idea how to fix it ? That is the default username / host php will attempt to use if you have not defined otherwise. I suggest you define your connection settings. Quote Link to comment Share on other sites More sharing options...
Caesar Posted June 11, 2007 Share Posted June 11, 2007 What does the config file for the software say? Without any code to look at...kinda hard to help you troubleshoot. Quote Link to comment Share on other sites More sharing options...
powerpower1 Posted June 12, 2007 Author Share Posted June 12, 2007 well it should use root, every other script we have on the server works fine, except this script that im having a problem with......conf file contains the correct info its something to do with php5 .......script worked fine on php4 Quote Link to comment Share on other sites More sharing options...
trq Posted June 12, 2007 Share Posted June 12, 2007 Can we see the relevant connection info? Quote Link to comment Share on other sites More sharing options...
phpvox Posted June 12, 2007 Share Posted June 12, 2007 its something to do with php5 .......script worked fine on php Quote Link to comment Share on other sites More sharing options...
trq Posted June 12, 2007 Share Posted June 12, 2007 Did you define any default mysql user / host in your php.ini for php4? Have you done the same with php5? Quote Link to comment Share on other sites More sharing options...
phpvox Posted June 12, 2007 Share Posted June 12, 2007 no, could you please tell me how i can find out ??? i know how to open php.ini but what should i look for and what should i change it to ?? sorry im newbie to mysql Quote Link to comment Share on other sites More sharing options...
trq Posted June 12, 2007 Share Posted June 12, 2007 There are a few directives relating to mysql's default values.... look for.... ; Default port number for mysql_connect(). If unset, mysql_connect() will use ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the mysql.default_port = mysql.default_socket = ; Default host for mysql_connect() (doesn't apply in safe mode). mysql.default_host = ; Default user for mysql_connect() (doesn't apply in safe mode). mysql.default_user = ; Default password for mysql_connect() (doesn't apply in safe mode). ; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password") mysql.default_password = Quote Link to comment Share on other sites More sharing options...
phpvox Posted June 12, 2007 Share Posted June 12, 2007 thorpe yes it is the same as yours Quote Link to comment Share on other sites More sharing options...
trq Posted June 12, 2007 Share Posted June 12, 2007 What about the one for php4 where the script works? Quote Link to comment Share on other sites More sharing options...
phpvox Posted June 12, 2007 Share Posted June 12, 2007 yes it works fine with php4 Quote Link to comment Share on other sites More sharing options...
trq Posted June 12, 2007 Share Posted June 12, 2007 No... have you defined the username / password combo in your php4 php.ini? Otherwise, like Ive said, we need to see where you define your connections settings. Quote Link to comment Share on other sites More sharing options...
phpvox Posted June 12, 2007 Share Posted June 12, 2007 well how come everything eles works just fine except this script, this is the only scrip that is giving an error Quote Link to comment Share on other sites More sharing options...
trq Posted June 12, 2007 Share Posted June 12, 2007 How should I know?..... You wont post the relevant information. Quote Link to comment Share on other sites More sharing options...
phpvox Posted June 12, 2007 Share Posted June 12, 2007 what should i post ?? what file do u want to see? thanks Quote Link to comment Share on other sites More sharing options...
trq Posted June 12, 2007 Share Posted June 12, 2007 I need to see where you define the username and password for connecting to the database. (Blank out the password obviously for securities sake though.) Quote Link to comment Share on other sites More sharing options...
phpvox Posted June 12, 2007 Share Posted June 12, 2007 <xml> <section name="DATABASE CONFIGURATION"> <field type="select" name="db_type" text="Select your database type">MySQL<enum val="MySQL">1</enum> </field> <field required="1" type="edit" name="db_host" text="Your database host (it may be an IP address)">localhost</field> <field required="1" type="edit" name="db_login" text="Your database username">DATABASE NAME</field> <field type="edit" name="db_pswd" text="Your database password">PASSWORD</field> <field required="1" type="edit" name="db_name" text="Database name">USER NAME</field> </xml> Quote Link to comment Share on other sites More sharing options...
trq Posted June 12, 2007 Share Posted June 12, 2007 Is this the only place you can define it? Is all the code itself encrypted? Quote Link to comment Share on other sites More sharing options...
phpvox Posted June 12, 2007 Share Posted June 12, 2007 yes this is the only file, the database info are 100 % correct, ive checked them 20 times and i also had someone eles look at them just in case i missed something everything is encoded except the templates folder...... Quote Link to comment Share on other sites More sharing options...
phpvox Posted June 12, 2007 Share Posted June 12, 2007 i know this is pain in the butt Quote Link to comment Share on other sites More sharing options...
phpvox Posted June 12, 2007 Share Posted June 12, 2007 is this true ????????? The problem was that your PHP version was upgraded to 5.0.4. PHP5 deals with things differently than PHP4 does. Quote Link to comment Share on other sites More sharing options...
trq Posted June 12, 2007 Share Posted June 12, 2007 is this true No. Quote Link to comment Share on other sites More sharing options...
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.