Link to home
Create AccountLog in
Avatar of onyourmark
onyourmark

asked on

connecting to a database test.db

I am using a shared server. I want to connect to a file called test.db which I placed in my public_html directory. I am getting an error

I have the code:
define('DB_HOST', 'localhost');
define('DB_USER', 'user');
define('DB_PASS', 'password');
define('DB_DATABASE', 'test.db');

$conn = mysql_connect(DB_HOST, DB_USER, DB_PASS);

I think this does not work when I am connecting to a database in the same folder that has not been set up by the ISP. Is there some way to modify this to get it to work?

The error is
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'me_'@'localhost' (using password: YES) in /home/me/public_html/getData.php on line 73
Unable to connect to DB: Access denied for user 'me_'@'localhost' (using password: YES)
ASKER CERTIFIED SOLUTION
Avatar of wildzero
wildzero

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of onyourmark
onyourmark

ASKER

I have a python script that creates a sqlite database called test.db. I run this python script on my local computer. Then I uploaded test.db to the shared server where I have an account. I want to connect to it using the php code I posted above. I wanted to connect without having the ISP administrator do anything. Is this possibe?
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account