470,862 Members | 1,699 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,862 developers. It's quick & easy.

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

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
3 49235
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
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
"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.

Similar topics

reply views Thread by Ryan Schefke | last post: by
7 posts views Thread by George Hester | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.