Connecting Tech Pros Worldwide Help | Site Map

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

photoelectric
Guest
 
Posts: n/a
#1: Jul 17 '05
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: 'nobody@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();
?>
phpman99
Guest
 
Posts: n/a
#2: Jul 17 '05

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


That error means that the database group29 doesn't exist. Check your
database names.


"photoelectric" <lumieroo7@aol.com> wrote in message
news:a9348916.0405011711.10fe57d2@posting.google.c om...[color=blue]
> 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: 'nobody@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();
> ?>[/color]


Tim Van Wassenhove
Guest
 
Posts: n/a
#3: Jul 17 '05

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


In article <a9348916.0405011711.10fe57d2@posting.google.com >, photoelectric wrote:[color=blue]
> Warning: mysql_connect() [function.mysql-connect]: Access denied for
> user: 'nobody@software-ece.rutgers.edu' (Using password: YES) in
> /ece/under/group14/public_html/insert.php on line 7
> Unable to Select database[/color]

So it says that the user nobody@host is not allowed to use $database.
[color=blue]
><?
> $username = "group29";
> $password = "xxxxxx";
> $database = "group29";
>
> mysql_connect('software-ece.rutgers.edu:3306',$user,$password);[/color]

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
Adriaan
Guest
 
Posts: n/a
#4: Jul 17 '05

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


"Tim Van Wassenhove" wrote[color=blue][color=green]
> > $username = "group29";[/color][/color]
[...][color=blue][color=green]
> > mysql_connect('software-ece.rutgers.edu:3306',$user,$password);[/color]
>
> Should be $username instead of $user.[/color]

....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


Closed Thread