473,591 Members | 2,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_bettin a", "") or die ('I
cannot connect to the database because: ' . mysql_error());
mysql_select_db ("coaster_coast ers");
?>

I get the following message:

Warning: mysql_connect() : Access denied for user
'coaster_bettin a'@'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_bettin a'@'localhost' (using password: YES)

I also tried with:

$db_name = "coaster_coaste rs";
$db_user = "coasters_betti na";

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 5341
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_bettin a", "") 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_betti na")? 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_coast ers");
: ?>

Where did this name come from ("coaster_coast ers")? 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_bettin a", "") 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_d b ("coaster_coast ers");
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_betti na'@'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_betti na'@'localhost' (using password: YES)

I also tried with:

$db_name = "coaster_coaste rs";
$db_user = "coasters_betti na";
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_betti na".
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_coaste rs" 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_coaster s 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
3340
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 know why. The following is a function i will call to insert the database. Thx!!! function AddPart($Partnumber, $Partname, $Partdescription) { //Set the variables for the database $DBName="krista";
6
4132
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 machine. I've been working on another program (an applet) to send and receive data over the internet. I got the applet to connect with the database and receive data. All the while I was developing the applet, I would tell it to find the database at...
1
3008
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 server. mysql_real_connect
2
2133
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 issue with Active Directory. Our network consists of Windows-2000 Servers (SP 4) and Windows-2000 workstations and Windows-XP workstations. We also have SQL Server 2000 (SP2) in three Windows-2000 servers. All work fine. Recently, we get a...
1
1973
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 connection string, it never succeeds. I try every different naming convention for my machine that I can in the server name field.
8
5460
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 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
10
4440
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 Enterplise Linux 3 ES, and applied FixPack fp5_mi00069.tar to it. After creating an instance, starting the database, creating a database, and entering the table definitions, all of which seems to work OK, I entered a tiny 8-row table and can do...
6
13318
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. Check out the screen snapshot below, from which you'll see that the popup menu frrom right-clicking on the table name does not have the "Open table" option. What is going on? http://farm1.static.flickr.com/167/426251515_b839620d0b_o.png
3
1738
by: Raymond Chiu | last post by:
Dear All, I have posted my question as below. But no answers, hope it can found here. http://forums.microsoft.com/msdn/ShowPost.aspx?postid=3377176&isthread=true&siteid=1&authhash=e09bd5812ef06751e9618ca5e2acbf8709a7521a&ticks=633469349810029562
0
7934
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7870
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8236
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8225
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6639
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5732
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3850
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1465
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1199
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.