473,474 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 49521
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ryan Schefke | last post by:
------=_NextPart_000_0077_01C34C8B.2B90C960 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ..I just sent this out to the win32 distribution list but no one has...
7
by: George Hester | last post by:
Please take a look at this google artcle: http://groups.google.com/groups?hl=en&lr=&frame=right&th=55d6f4b50f5f9382&seekm=411f370d%241%40olaf.komtel.net#link9 The op was having trouble with...
14
by: jolinlim | last post by:
Warning: mysql_connect(): Access denied for user: 'ODBC@localhost' (Using password: NO) in c:\appserv\www\sql.php on line 12 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link...
1
by: servo | last post by:
I created a user "test1" (which then got the username "debscrof_test1" from CPanel), a password for the user "test2", and then added the user to a new database "testdb" with all priviliges Then a...
0
by: vozzek | last post by:
Hi all, I've got a mySQL database I've been working with as my localhost for several months now, no connection problems. I'm at the point however, where I need to connect to the database from...
2
by: sbettadpur | last post by:
hello I am getting following error while connecting to mysql through php Warning: mysql_connect() : Access denied for user: 'pds@localhost' (Using password: YES) Actually I hosted one...
5
by: lisles | last post by:
i have a page funtion.php which hs the function to connect to the db /* Mysql Connection */ function connect(){ global $db_server,$db_user,$db_pass,$db;//Global Values from the config.php...
5
by: Joel Phelan | last post by:
I am getting the below error when attempting to run a php script on my server which accesses a mysql table I have created in an existing database. I can connect to the database table via the MySQL...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.