It shows that you are unregistered. Please register with us by clicking Here
![]() |
|
![]() |
![]() | Register - FAQ - Today's Posts - New Posts - Support - Search | ![]() |
|
|
#1 (permalink) |
|
Member
Join Date: Jul 2006
Age: 38
Posts: 30
|
Hi Everybody,
First let me say I am very grateful to have found a place where I can get some help learning PHP! I am learning by myself out of books, and have no experience with other languages other than html and css. I am creating a script (given in a book) that is supposed to take a username and password from a form, and check that it is in a mysql database, and then, if a match is found, echo a message. I can't get it to work, and I think the place where it is failing is the sql query itself, so I am hoping that someone may see something from with the syntax. The query I am using is $sql= "SELECT * FROM $table_name WHERE username = '$_POST[username]' AND password = password('$_POST[password]')"; I am using PHP 5.1.2, and mysql 4.1.15. Thanks so much for checking this out! Best, mysql remote connection Hello. I hope somebody can help me solve this one. I need to connect remotely to a mysql server using: mysql -u remoteuser -h x.x.x.x -p Where x.x.x.x is the ip address of the remote mysql server. On the remote server, I already issued the following grant commands: grant all privileges on dbname.* to remoteuser@'localhost' identified by 'passwd' grant all privileges on dbname.* to remoteuser@'%' identified by 'passwd' The above two commands should allow a connection from anywhere. Also, port 3306 is not blocked in the firewall. But when I run the command below from a remote machine: mysql -u remoteuser -h x.x.x.x -p I get the error: ERROR 2003: Can't connect to MySQL server on 'x.x.x.x' (113) What have I missed? Server version: 4.1.19 Gabriel |
|
|
|
|
|
|
|
#2 (permalink) |
|
Senior Member
Join Date: Jul 2006
Age: 30
Posts: 124
|
The problem isn't php, it's a permissions issue with mysql. I would sugget locking things down to the specific ip.
grant all privileges on dbname.* to remoteuser@'xxx.xxx.xxx.xxxx' identified by 'passwd' Also, I wouldn't use grant all, only the permissions that you need. Let me know if that helps. |
|
|
|