me222 Posted May 1, 2007 Share Posted May 1, 2007 Hi, can anybody help me, because I am having trouble connecting to a database. This is the error message that I get everytime I open the site: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'DB_SERVER_USERNA'@'localhost' (using password: YES) in /home/me222/public_html/includes/functions/database.php on line 12 Unable to connect to database server! Below is my config.php: define('DB_SERVER_me222', ''); // your username that you use to log into your web server define('DB_SERVER_handyman', ''); // your password that you use to log into your web server define('DB_DATABASE', 'me222_books'); // replace username with your web server username define('DIR_FS_CATALOG', '/home/me222/public_html/'); define('HTTP_SERVER', 'http://www.site.com'); define('HTTP_COOKIE_DOMAIN', '.site.com'); // do not include the www define('DB_SERVER', 'localhost'); define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('HTTPS_COOKIE_DOMAIN', ''); define('HTTP_COOKIE_PATH', '/'); define('HTTPS_COOKIE_PATH', ''); define('DIR_WS_HTTP_CATALOG', '/'); define('DIR_WS_HTTPS_CATALOG', ''); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('HTTPS_SERVER', ''); define('ENABLE_SSL', false); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); define('USE_PCONNECT', 'false'); define('STORE_SESSIONS', 'mysql'); ?> Thanks Ellie Link to comment https://forums.phpfreaks.com/topic/49508-php-for-mysql/ Share on other sites More sharing options...
clown[NOR] Posted May 1, 2007 Share Posted May 1, 2007 well.. i have never connected to a database that way.. so if it's possible, i don't know... why dont you connect with mysql_connect()? Link to comment https://forums.phpfreaks.com/topic/49508-php-for-mysql/#findComment-242647 Share on other sites More sharing options...
me222 Posted May 1, 2007 Author Share Posted May 1, 2007 Thanks for the info, but I am not much of a programmer, actually knows almost nothing about computers. I bought the script from somebody else. It is supposed to be very simple just by modifying the lines in the config file, but unfortunately it doesn't work. Anyway thank you for trying to help Ellie Link to comment https://forums.phpfreaks.com/topic/49508-php-for-mysql/#findComment-242774 Share on other sites More sharing options...
roopurt18 Posted May 1, 2007 Share Posted May 1, 2007 Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'DB_SERVER_USERNA'@'localhost' (using password: YES) in /home/me222/public_html/includes/functions/database.php on line 12 Unable to connect to database server! clown, if you read the error message you will see that the OP is using mysql_connect as it is mysql_connect that is generating the error. To the OP, the pertinent part of the error is: Access denied for user 'DB_SERVER_USERNA'@'localhost' Where ever the code is that actually connects, it is trying to use a constant named DB_SERVER_USERNA. The code you posted: <?php define('DB_SERVER_me222', ''); // your username that you use to log into your web server define('DB_SERVER_handyman', ''); // your password that you use to log into your web server define('DB_DATABASE', 'me222_books'); // replace username with your web server username ?> You have changed DB_SERVER_USERNA to DB_SERVER_handyman. Try: <?php define('DB_SERVER_USERNA', 'handyman'); ?> I have a feeling you're going to receive more errors though. Link to comment https://forums.phpfreaks.com/topic/49508-php-for-mysql/#findComment-242797 Share on other sites More sharing options...
me222 Posted May 1, 2007 Author Share Posted May 1, 2007 Hey this is the clown talking. Thanks for your help. You fix my problem. I wish I am as smart as you. Link to comment https://forums.phpfreaks.com/topic/49508-php-for-mysql/#findComment-242823 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.