Page 1 of 1
free host access and database access
Posted: Thu Aug 14, 2008 5:19 am
by koguee
i was wondering if someone could help me solve my problem:
i have an account at justfree.com (free php/jsp hosting site) but i cannot access the database every time i try to access it using PHP codes. i use the basics of accessing the site:
mysql_connect('domain.justfree.com','phpadminusername','password') or die(...);
at this point, i cannot connect to the site and tells me that it cannot access the thing.
it shows something like this:
'phpadminusername'@'localhost...' using password: YES
sorry but i am a newbie.
thanks for taking time to read this.
hope you could help.
Re: free host access and database access
Posted: Thu Aug 14, 2008 6:04 am
by desmi
does justfree.com provide mysql access too ?
Re: free host access and database access
Posted: Thu Aug 14, 2008 11:50 am
by koguee
yes they do have. do you think that's the reason? have i not configured something that i should for it to work?
thanks for the reply.
Re: free host access and database access
Posted: Thu Aug 14, 2008 11:55 am
by desmi
So you have username and password for mysql, try to log in to see if your username and password are correct.
after that, if you still got problems, please also post your code here.
Re: free host access and database access
Posted: Thu Aug 21, 2008 1:40 am
by koguee
if anyone could answer my problem, please help:
based from the aforementioned posts, i cannot access my database and the host
per se using a .php code. I don't know what type of access it wants me to create so i could access it. so here are the information that might give you hints why i cannot do the thing:
creating a simple access test, i made this:
Code: Select all
<?php
$host='sandf.justfree.com';
$user='sandf_kog';
$pass='mypassword';
$con=$mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db('sandf_sheets') or die(mysql_error());
echo 'accessed!';
mysql_close($con);
?>
the lines above would show something like this on the broswer.
but if i use sandf_kog and my password, i can access my phpMyAdmin 2.8.2
Code: Select all
[b]Access denied for user 'sandf_kog'@'layeredpaneltest1.justfree.com' (using password: YES)[/b]
i also don't know if my syntax would fit the versions of phpMyAdmin and MySQL. here they are:
MySQL - 5.0.27-Debian_0.dotdeb.1
* Protocol version: 10
* Server: justfree.com (Localhost via UNIX socket)
* User: sandf_kog@localhost
* MySQL charset: UTF-8 Unicode (utf8)
phpMyAdmin - 2.8.2
* MySQL client version: 4.0.24
* Used PHP extensions: mysql
Does it matter? Wish someone could help me fix this. every reply would be very much appreciated.
Re: free host access and database access
Posted: Thu Aug 21, 2008 12:47 pm
by dajawu
Try using just localhost for the hostname.
Code: Select all
mysql_connect("localhost","user","pass") or die(mysql_error());
Re: free host access and database access
Posted: Fri Aug 22, 2008 2:20 am
by koguee
thanks. that worked.
wow. after long time of tries and everything. you are the one i'm waiting for.
thanks. again.
Re: free host access and database access
Posted: Fri Aug 22, 2008 8:14 am
by dajawu
No Problem, glad I could help. I know how frustrating the little things can be.