Page 1 of 1
connect to mysql server from remote on redhat
Posted: Mon Aug 06, 2007 5:13 am
by cade
helllo
I just made a quick reference and found a lot of things on how to connect remote to server.
How to configure the mysql server and client? And what is SSH? Do i need to adjust IP tables. Can someone guide me?
Thanks
Posted: Mon Aug 06, 2007 6:08 am
by feyd
Did searching not give you any leads?
Posted: Wed Aug 08, 2007 9:00 pm
by cade
no
Re: connect to mysql server from remote on redhat
Posted: Wed Aug 08, 2007 10:03 pm
by VladSun
cade wrote:How to configure the mysql server and client?
You'll have to GRANT users on the remote machine (client) some prvileges. Example:
Code: Select all
mysql> grant all on database_name.* to user_name@host_name_or_ip identified by 'your_password_for_remote_client_here';
cade wrote:And what is SSH?
It is secured connection to your server - e.g. you can run shell commands in the server. If you are using Windows on the client PC search for "PuTTY".
cade wrote:Do i need to adjust IP tables.
It is "iptables"

It is the "firewall" for Linux based servers. You will have to open port 3306 for the client's host. E.g.:
Code: Select all
iptables -I INPUT -p tcp --dport 3306 -s CLIENT_IP_HERE -j ACCEPT
iptables -I OUTPUT -p tcp --sport 3306 -d CLIENT_IP_HERE -j ACCEPT
Also, you have to check if you MySQL server accepts TCP connections - you should run it without "--skip-networking" option. The same applies to your MySQL config file.
Posted: Thu Aug 09, 2007 3:26 am
by timvw
I wouldn't allow external connections to the database, because (afaik) mysql sends unencrypted data... I'd rather setup an ssl tunnel and send the data over that connection.
eg:
Code: Select all
ssh -N -L 3307:example:3308 timvw@example
Now my program can connect to localhost:3307and ssh will make sure that it ends up at example.:3308 without others being able to see the actual data

For windows users i suggest that you take a look at
Plink.
Posted: Fri Aug 17, 2007 2:31 am
by cade
I have try to update user and set new password for new user and new host.
I also have adjusted my.cnf file and bind the IP address to mysql server.
Can anyone tell me what is going on?
I don't like linux.
It's not friendly to me.
The iptables also not present in my client's linux system. How can I bypass this setting
I have search all over the internet to revoke those setting but now it didn't work. It really depressed when things become more worse than I thought. Please advise how to revert those setting. Please....
Posted: Fri Aug 17, 2007 3:43 am
by VladSun
OK. Let's do some checks:
First run
You chould get an ouput like this:
Code: Select all
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
Please, post it here.
If you it isn't the case run:
You should get an output containing several lines with numbers - if it isn't the case then mysql is not runing.
If iptables is not installed on your system, then probably you don't have a firewall at all, so it isn't a firewall problem.
Posted: Fri Aug 17, 2007 3:44 am
by VladSun
OK. Let's do some checks:
First run
You chould get an ouput like this:
Code: Select all
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
Please, post it here.
If you it isn't the case run:
You should get an output containing several lines with numbers - if it isn't the case then mysql is not runing.
If iptables is not installed on your system, then probably you don't have a firewall at all, so it isn't a firewall problem.
PS: "Linux is unfriendly" - you mean it is not a "NxNext clicks" administration
