List:General Discussion« Previous MessageNext Message »
From:Steve Edberg Date:February 4 2001 1:03am
Subject:Re: From Windows access to MySQL on Linux
View as plain text  
At 10:15 PM +0700 2/3/01, Kiky wrote:
>Thank you for your reply :-)
>
>>  Yes, you can add a mysql user that has access to mysql server from the
>>  windows host and use this user to create the connection.
>
>## Is it possible to do this in PHP under Windows, without installing
>any
>mysql driver for ODBC, or any other additional installation ?
>Can I  just do the same way of connection to mysql database, just like
>the one
>I use in PHP under Linux ?
>
>mysql_connect("127.0.0.1", "root", "");
>mysql_select_db("my_database")


Just replace '127.0.0.1' (a.k.a. 'localhost') with the database 
server's ip address or name. Some things you have to be sure of to do 
this:

(1) The database server machine's mysql wasn't started with 
--skip-networking (I'm pretty sure that's the parameter); if it was, 
MySQL won't be listening to the internet at all, and will need to be 
restarted without that parameter.

(2) Make sure the server's permission tables will allow access from 
your web server - see the GRANT command;

(3) Make sure the database server isn't behind a firewall or 
something that restricts internet access to the MySQL port (normally 
3306)

If all these conditions are met, your the database server can be 
anywhere. Keep in mind, though, that if your query returns a large 
number of results, response will be limited by the speed of the 
network(s) between the two machines.

	- steve


>Thank you,
>Helen
>


-- 
+--- "They've got a cherry pie there, that'll kill ya" ------------------+
| Steve Edberg                           University of California, Davis |
| sbedberg@stripped                               Computer Consultant |
| http://aesric.ucdavis.edu/                  http://pgfsun.ucdavis.edu/ |
+-------------------------------------- FBI Special Agent Dale Cooper ---+
Thread
From Windows access to MySQL on LinuxKiky3 Feb
  • Re: From Windows access to MySQL on LinuxRamy M. Hassan3 Feb
    • Re: From Windows access to MySQL on LinuxKiky3 Feb
      • Re: From Windows access to MySQL on LinuxSteve Edberg4 Feb