A
A
Alexander Bagirov2014-06-09 19:21:27
MySQL
Alexander Bagirov, 2014-06-09 19:21:27

How to find MySQL server address?

Good evening!
I installed on my VPS (Ubuntu) MySQL-server.
In the settings, I commented out the line from which IP addresses you can connect to the server. Now you can connect from anywhere.
Can you please tell me how can I find the server address to connect to?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Semyon Voronov, 2014-06-10
@alexbagirov

Hmm, well, advice.
See what mysql is listening on, if there is no Internet connection, see what socket it uses

[08:43] ~  (dcn01srv056)
$ netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      31555/mysqld
tcp        0      0 127.0.0.1:49002         0.0.0.0:*               LISTEN      3264/uwsgi
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      2774/nginx

From the example, you can see that mysqld listens on localhost-e, tcp port 3306.
In the nginx daemon example, it listens on 0.0.0.0, tcp port 80 - this means it accepts connections on any available network addresses in the system on port 80. You need to try to get rid of this without a direct need.

A
arku, 2014-06-09
@arku

Em.

By default, MySQL only allows connections from the localhost address.

It turns out that if you commented out, then nothing has changed.
When possible, use the same address as the VPS.
However, doing so is strongly discouraged . I recommend using SSH tunnel to connect through localhost. A handy program that supports this and has a graphical interface for configuration is Navicat. However, the standard MySQL Workbench also supports it.

V
Vit, 2014-06-09
@fornit1917

make ifconfig on the server and look at the IP address.
And I want to add right away that "commenting out the line in the config" is not enough to connect from remote servers. You need to create a user in MySQL indicating that he can connect not only from localhost webew.ru/articles/414.webew

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question