By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,978 Members | 1,362 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,978 IT Pros & Developers. It's quick & easy.

Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'nobody@

P: n/a
When trying to run the below script on an apache/1.3.26 with mysql and
php I get the following error message:

Warning: mysql_connect() [function.mysql-connect]: Access denied for
user: 'n*****@software-ece.rutgers.edu' (Using password: YES) in
/ece/under/group14/public_html/insert.php on line 7
Unable to Select database

I have no idea what the cause is, any help would be appreciated.
Thanks in advance.

<?
$username = "group29";
$password = "xxxxxx";
$database = "group29";

mysql_connect('software-ece.rutgers.edu:3306',$user,$password);
@mysql_select_db($database) or die("Unable to Select database");

$query="CREATE TABLE contacts(id int(6) NOT NULL auto increment, first
varchar(15) NOT
NULL, last varchar(15) NOT NULL, phone varchar(30) NOT NULL, mobile
varchar(20) NOT NULL,
fax varchar(20) NOT NULL, email varchar(30) NOT NULL, web varchar(30)
NOT NULL,
PRIMARY KEY(id), UNIQUE id(id), KEY id_2(id))";

mysql_query($query);
mysql_close();
?>
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
That error means that the database group29 doesn't exist. Check your
database names.
"photoelectric" <lu*******@aol.com> wrote in message
news:a9**************************@posting.google.c om...
When trying to run the below script on an apache/1.3.26 with mysql and
php I get the following error message:

Warning: mysql_connect() [function.mysql-connect]: Access denied for
user: 'n*****@software-ece.rutgers.edu' (Using password: YES) in
/ece/under/group14/public_html/insert.php on line 7
Unable to Select database

I have no idea what the cause is, any help would be appreciated.
Thanks in advance.

<?
$username = "group29";
$password = "xxxxxx";
$database = "group29";

mysql_connect('software-ece.rutgers.edu:3306',$user,$password);
@mysql_select_db($database) or die("Unable to Select database");

$query="CREATE TABLE contacts(id int(6) NOT NULL auto increment, first
varchar(15) NOT
NULL, last varchar(15) NOT NULL, phone varchar(30) NOT NULL, mobile
varchar(20) NOT NULL,
fax varchar(20) NOT NULL, email varchar(30) NOT NULL, web varchar(30)
NOT NULL,
PRIMARY KEY(id), UNIQUE id(id), KEY id_2(id))";

mysql_query($query);
mysql_close();
?>

Jul 17 '05 #2

P: n/a
In article <a9**************************@posting.google.com >, photoelectric wrote:
Warning: mysql_connect() [function.mysql-connect]: Access denied for
user: 'n*****@software-ece.rutgers.edu' (Using password: YES) in
/ece/under/group14/public_html/insert.php on line 7
Unable to Select database
So it says that the user nobody@host is not allowed to use $database.
<?
$username = "group29";
$password = "xxxxxx";
$database = "group29";

mysql_connect('software-ece.rutgers.edu:3306',$user,$password);


Should be $username instead of $user.

Just as with mysql_select_db below, you could write
mysql_connect('host','user','pass') or die (mysql_error());
--
http://home.mysth.be/~timvw
Jul 17 '05 #3

P: n/a
"Tim Van Wassenhove" wrote
$username = "group29"; [...] mysql_connect('software-ece.rutgers.edu:3306',$user,$password);


Should be $username instead of $user.


....which the original poster would have easily detected when enabling a
stricter syntax, either in code, per-directory in Apache's .htaccess or even
globally in php.ini: http://php.net/errorfunc

Adriaan
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.