connecting to MySQL
Posted by: perpetualshaun (---.dsl.dytnoh.ameritech.net)
Date: May 29, 2006 05:24PM

I just installed the WAMPSERVER today, and it's working well in many regards. I can pull up the PHP MyAdmin tool w/o a problem, but my scripts aren't connecting for some reason. I have a MySQL connect config file like this:

$mysql_host = 'localhost';
$mysql_uname = '';
$mysql_password = '';
$mysql_db_name = 'my_database';

// SETTING UP MySQL CONNECTION
$connection = mysql_connect($mysql_host, $mysql_uname, $mysql_password) or die ('I cannot connect to the database. Make sure that mysql is installed and that you are trying to log in as a valid user.');
mysql_select_db ($mysql_db_name) or die ('The database specified in database_name must exist and must be accessible by the user specified in mysql_connect.');

But it returns an error like this:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in E:\WebFiles\dynamic_calendar\core_files\version 2.5 (2006-02-01)\single\install.php on line 129
I cannot connect to the database. Make sure that mysql is installed and that you are trying to log in as a valid user.

I used to run the PHP Triad, and this is how I always connected to my localhost MySQL. I'm happy to change it to use a default username and password locally, but don't know how to do so. Any ideas?

Thanx,
Shaun

Options: ReplyQuote
Re: connecting to MySQL
Posted by: CyberSpatium (67.170.181.---)
Date: May 29, 2006 09:22PM

change this:
$mysql_uname = '';

to
$mysql_uname = 'root';

Options: ReplyQuote


Sorry, only registered users may post in this forum.