472,791 Members | 1,065 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,791 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 5263
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
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.