Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remote mysql db access config question 1

Status
Not open for further replies.

Developer8

Programmer
Sep 25, 2002
14
US
I want to access a mysql database (on linux) from another linux box. I type in:

mysql -hservername -uusername -ppassword databasename

and it tells me that my server ip is not allowed to access the mysql database. How would I configure mysqlaccess.conf to allow remote access?
 
#$Param{'host'} = '';
$Param{'user'} = 'nobody';
$Param{'db'} = 'test';
$Param{'password'} = 'foobar';
$Param{'debug'} = 0;

See the $Param{'host'} = ''; In the = ''; field, put your IP address in the ''; field.
 
Thanks...

I was able to login as root to mysql and add a remote user using the grant command.

---------- On the remote server:

GRANT SELECT ON TABLENAME TO USER@SERVERNAME
IDENTIFIED BY PASSWORD;

GRANT INSERT ON TABLENAME TO USER@SERVERNAME
IDENTIFIED BY PASSWORD;

---------- In my Perl program on the local server:

$driver = "mysql";
$database = "databasename";
$hostname = "servername";
$dsn = "DBI:$driver:database=$database;host=$hostname";
($username, $password) = ('username', 'password');
$dbh = DBI->connect($dsn, $username, $password);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top