paololzki Posted February 12, 2008 Share Posted February 12, 2008 hi, i need help. im experiencing this error in my site. Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) Access denied for user 'ODBC'@'localhost' (using password: NO) here's my code class config_ondairon{ var $dbHost; var $dbUsername; var $dbPassword; var $dbName; var $rateGroup; function config_dms() { $this->dbHost = "localhost"; $this->dbUsername = "root"; $this->dbPassword = "******"; $this->dbName = "dbname"; } } // end class $ondaironmainconf = new config_ondairon(); class ondairon_function { function connect(){ global $ondaironmainconf; session_start(); $this->link = mysql_connect($ondaironmainconf->dbHost, $ondaironmainconf->dbUsername, $ondaironmainconf->dbPassword) or die(mysql_error()); mysql_select_db($ondaironmainconf->dbName) or die(mysql_error()); } function disconnect(){ mysql_close($this->link); } } // end class $ondaironmainfunc = new ondairon_function(); Quote Link to comment https://forums.phpfreaks.com/topic/90616-access-denied-for-user-odbclocalhost/ Share on other sites More sharing options...
Lamez Posted February 12, 2008 Share Posted February 12, 2008 is your password correct? If you do not have a password, then set it like this $this->dbPassword = ""; Quote Link to comment https://forums.phpfreaks.com/topic/90616-access-denied-for-user-odbclocalhost/#findComment-464567 Share on other sites More sharing options...
paololzki Posted February 12, 2008 Author Share Posted February 12, 2008 i dont think its in my password. if its my password the error should be Access denied for user 'root'@'localhost' but the error indicates ODBC@localhost Quote Link to comment https://forums.phpfreaks.com/topic/90616-access-denied-for-user-odbclocalhost/#findComment-464576 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.