Web Hosting Talk







View Full Version : How do you set mysql so that you and connect with a different server?


hoot
03-06-2002, 02:31 PM
Hi I'm still pritty new to mysql and one of my customers wants me to set him up a database user so that he can connect to the database from his home computer, what are the commands to do this ?

hoot

freakysid
03-06-2002, 02:45 PM
Hi to be able to connect to mysql on your server, your customer will need shell access telnet/ssh. Unless your customer uploads and configures phpmyadmin or you provide an installation of phpmyadmin for your users. I assume that you set up a mysql user for each client that has a mysql database. Mind you, I am not a web host myself, but that is what you would want to do anyway - you don't want users using the root account because then they would have access to all the mysql databases on the server. For information on setting up mysql users see the manual at www.mysql.com - but perhaps you already know how to do this. :)

DomiNET.net
03-06-2002, 02:45 PM
hello

use mysql database and theres a user table, find his record and change its host field to *.*.*.* (or his ip)

hrmm...


He wants to connect via odbc to mysql?

AudiBoy
03-06-2002, 02:51 PM
If he would like to connect to the database from another server, you will need to ad another entry to your 'user' table in your your 'mysql' database. Typically new users are created with the 'host' being set to 'localhost'. This would allow them to connect from a script that is stored on your server. If they want outside access, then you need to ad a new entry for that user with the 'host' name of their server. This could be the IP address or the actual host name, depending on your Mysql setup. There may also be a way to set this to a wildcard? I'm not sure....

But the above should get you started in the right direction

mpkapadia
03-06-2002, 04:07 PM
hoot

You can set the database permission to ANY instead of localhost
That should do the trick ,Advisable however to keep only the ip of other server from where you are gonna access your database

Regards

S2 Web Design
03-06-2002, 04:18 PM
If you want to do it from the mysql command line instead of phpmyadmin, the following is an example:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER on database_name.* to user_name@'location_name_or_IP' identified by 'password';

bitserve
03-07-2002, 01:50 AM
The "wildcard" that you probably want to use for the Host is the percent sign "%".

Although you really should be blocking the mysql port with a firewall, the above is not recommended, but unfortunately you can't specify netmasks. So if they don't have a static IP, it gets tricky.

c3uc3
02-12-2005, 07:50 PM
Hi Sir,

Is there in anyway from the MySQL command I may allow wildcard only for specific database in MYSQL?