Board index   FAQ   Search  
Register  Login
Board index php forum :: Database MySQL Installation

Difficulties connecting to DB on WEB Server

Installation and configuration iussues

Moderators: macek, egami, gesf

Difficulties connecting to DB on WEB Server

Postby groo_78 » Thu Apr 22, 2004 7:56 pm

Hey,

I've checked the internet, these forums, and pretty near everywhere you can imagine and even the books i have don't have any suggestions.

I recently installed APACHE/PHP/MYSQL on my XP machine and started working with it and i produced a web page and it works la de da. A friend of my has web space through MediaTemple with php/mysql support so he is letting me use about 20 mgs and i tried the same code but to no avail. My code gives me the following error:

Connected successfully Access denied for user: '@localhost' to database 'database_name'

and my code is:

$connection = mysql_pconnect("localhost")
or die(mysql_error());

print ("Connected successfully\r\n");

mysql_select_db("database_name", $connection)
or die(mysql_error());

I have tried adding the mysql_pconnect("localhost", $username, $password) but i get the same error.

Although i have some past experience with ASP/Oracle/Access , i have always had an admin set me up - ie - give me the ftp foler to upload my files and the connection string was supplied. I don't even know exactly what files to upload!! I pretty much just uploaded the folder titled 'database_name' from c:\mysql\bin. THe only files in the folder are *.frm files. ANy suggestions?

Thanks in advance.
groo_78
New php-forum User
New php-forum User
 
Posts: 3
Joined: Thu Apr 22, 2004 7:41 pm

user err.

Postby ruturajv » Thu Apr 22, 2004 8:04 pm

please ask your friend for the complete username and password for mysql dB
that is where your problem is !
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

I Tried

Postby groo_78 » Thu Apr 22, 2004 8:09 pm

The database was created by myself. It is just a simple test. I didn't user a Username or Password when i created it. I tried adding one and it worked fine when i ran it locally on my machine but after i uploaded it and tried using:

mysql_pconnect("localhost", $username, $password)
or die(mysql_error());



i had the same problem.
groo_78
New php-forum User
New php-forum User
 
Posts: 3
Joined: Thu Apr 22, 2004 7:41 pm


Return to MySQL Installation

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.