|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi
I hope someone can help me here? my hosting ISP imposes access limits on use of Mysql. I have to telnet in and then change directory to /usr/local/mysql and call mysql by typing "./bin/mysql DATABASENAME --user=user --password=password" (without the quotes of course) just telnetting in and then typing "mysql..." doesnt work, I just get 'file not found' error when using php in a webpage I have to call mysql somehow. just using "mysql_connect("localhost", "user", "password");" (again, without quotes) doesnt work. any clues? thanks lee |
|
#2
|
|||
|
|||
|
There are 2 possibilities:
1. The "localhost" in mysql_connect("localhost", "user", "password") is probably where your problem is. Try substituting it with the IP address of the host you log into with telnet. or the hostname, or the hostname.domainname combo. Mysql can be configured to accept connections only from a certain host, which is usually what is meant by 'access restrictions' for mysql. BTW the shorthand for the mysql connect syntax is mysql DATABASENAME -u user -p (you are then prompted for the password in standard Unix style (so your password is not visible on the terminal) 2. PHP is not configured correctly. Your ISP should fix this. Also, if your ISP thinks it's imposing 'access limits' simply by making people cd to another directory, that's idiotic. I think it's more likely that #1 is the answer to your problem. |
|
#3
|
|||
|
|||
|
Thanks rycamor, I will give this a go.
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by rycamor: There are 2 possibilities: ....[/quote] |
|
#4
|
|||
|
|||
|
I tried using rycamor's suggestions above and still got rejected.
In case anyone else hits the problem, the appears is to replace "localhost" with "127.0.0.1:/path/to/socket", it works fine! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > mysql_connect to specific directory on server |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|