473,386 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Cannot connect to the database

Hello,

My domain: www.coaster.ch
My database: coasters
User: bettina

In the programm I wrote:

<?php
$db_server = "www.coaster.ch";
$db_name = "coasters";
$db_user = "bettina";
$db_passwort = "";
$dbh = mysql_connect ("localhost", "coaster_bettina", "") or die ('I
cannot connect to the database because: ' . mysql_error());
mysql_select_db ("coaster_coasters");
?>

I get the following message:

Warning: mysql_connect(): Access denied for user
'coaster_bettina'@'localhost' (using password: YES) in
/home/coaster/public_html/connection.php on line 11
I cannot connect to the database because: Access denied for user
'coaster_bettina'@'localhost' (using password: YES)

I also tried with:

$db_name = "coaster_coasters";
$db_user = "coasters_bettina";

What do I do wrong?
Here can I define a password for my database in phpMyAdmin?

Any help will be welcomed.

Bettina

Jul 17 '05 #1
4 5316
be*****@coaster.ch:
Here can I define a password for my database in phpMyAdmin?


Log in to phpmyadmin and click on "Privileges". There you can add a new
User and set the privileges.

After you added/changed a user make sure, that you click "Reload MySQL"
in PHPMyAdmin (first page after logon).

adlerweb
Jul 17 '05 #2
be*****@coaster.ch wrote:
: Hello,

: My domain: www.coaster.ch
: My database: coasters
: User: bettina

: In the programm I wrote:

: <?php
: $db_server = "www.coaster.ch";
: $db_name = "coasters";
: $db_user = "bettina";
: $db_passwot = ""; [[[ my typo messed something up here ]]]
You set a bunch of variables but you never use them, what are they for?
: $dbh = mysql_connect ("localhost", "coaster_bettina", "") or die ('I
^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^
-1- -2- -3-

-1-

Is the database on the localhost of the web server? Why did you need to
know the server name of mysql if it's just on the web server? (It
commonly is, but I have to ask.)

-2-

Where did you get that name from ("coaster_bettina")? In your intro you
said you were user "bettina".

-3-

Mysql accounts commonly have passwords. Does your account have a
password you need to use?

: cannot connect to the database because: ' . mysql_error());
: mysql_select_db ("coaster_coasters");
: ?>

Where did this name come from ("coaster_coasters")? I thought you said
the db name was "coasters".


--

This space not for rent.
Jul 17 '05 #3
>My domain: www.coaster.ch
My database: coasters
User: bettina

In the programm I wrote:

<?php
$db_server = "www.coaster.ch";
$db_name = "coasters";
$db_user = "bettina";
$db_passwort = "";
Why are you setting these variables if you are not using them?
$dbh = mysql_connect ("localhost", "coaster_bettina", "") or die ('I
You're using a blank password here; is that intended?
I doubt it.
cannot connect to the database because: ' . mysql_error());
mysql_select_db ("coaster_coasters");
That isn't the name of the database you claimed it was above.
?>

I get the following message:

Warning: mysql_connect(): Access denied for user
'coaster_bettina'@'localhost' (using password: YES) in
/home/coaster/public_html/connection.php on line 11
I cannot connect to the database because: Access denied for user
'coaster_bettina'@'localhost' (using password: YES)

I also tried with:

$db_name = "coaster_coasters";
$db_user = "coasters_bettina";
Since these variables are not used, who cares what you set them to?
What do I do wrong?
Here can I define a password for my database in phpMyAdmin?

Any help will be welcomed.


What is the actual user name you need to pass to MySQL?
You seem to be vascillating between "bettina" and "coasters_bettina".
Note that this may or may not have any relationship to what
you enter into some kind of "control panel" provided by your host.

What is the actual database name you need to pass to MySQL?
You seem to be vascillating between "coaster_coasters" and "coasters".

What is the actual host name you need to pass to MySQL?
You seem to be vascillating between "localhost" and "www.coaster.ch".
Even if these do refer to the same host, they are different from
the point of view of the MySQL permissions system.

What is the actual password you need to pass to MySQL? (don't
post the answer here!) My guess is that it's something besides
"".

Gordon L. Burditt
Jul 17 '05 #4
I created a database and called it "coasters" and a user called
"bettina"... the y will be shown afterwards as coaster_coasters and
coaster_bettina respectively.... I guess it is so because the domain is
"coaster"....

Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Krista | last post by:
Hi guys, i have a problem about inserting data into the table. I dont know why the output always said cannot be added to the database! Anyone has idea for me? i check the connect is ok, but dont...
6
by: Jeff Sandler | last post by:
I have a database I created in mySQL. I've been entering data every day into the database using a Java application that I wrote. The database and the Java program are on the same Win 98 SE...
1
by: ikrabbe | last post by:
Hi, I want to set up a mysql server in an embedded process. I managed to start the server in my program as described through mysql_server_init() Now I need a client connection to this...
2
by: Jay Chan | last post by:
We have just installed a SQL Server 2000 (SP 3A) onto a computer that has Windows-2003 Server on it. Now, we cannot get access to that database server from other computers. Seem like this may be an...
1
by: beck4353 | last post by:
Hi, I am using VS.NET Arch. and I am having problems connecting to ANY database. I am trying to a either a SqlConnection or OleDBConnection object to my project. When I try to define the...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
10
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat...
6
by: antonyliu2002 | last post by:
I was able to view table content easily before, but after I reinstalled everything, I cannot find the option to view table content in MS SQL Server Express. I can define table with no problem. ...
3
by: Raymond Chiu | last post by:
Dear All, I have posted my question as below. But no answers, hope it can found here. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.