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 ? Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/ 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. Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272747 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. Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272748 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 Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272782 Share on other sites More sharing options...
trq Posted June 12, 2007 Share Posted June 12, 2007 Can we see the relevant connection info? Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272783 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 Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272790 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? Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272792 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 Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272795 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 = Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272806 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 Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272819 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? Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272823 Share on other sites More sharing options...
phpvox Posted June 12, 2007 Share Posted June 12, 2007 yes it works fine with php4 Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272831 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. Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272833 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 Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272840 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. Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272841 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 Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272844 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.) Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272846 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> Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272849 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? Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272852 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...... Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272860 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 Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272873 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. Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-272979 Share on other sites More sharing options...
trq Posted June 12, 2007 Share Posted June 12, 2007 is this true No. Link to comment https://forums.phpfreaks.com/topic/55180-can-someone-solve-this/#findComment-273167 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.