M
M
Maxim2015-08-15 12:30:06
MySQL
Maxim, 2015-08-15 12:30:06

How to give remote access to mysql?

There is a remote server on centos7, it has mariadb
content /etc/my.cnf

[mysqld]
datadir=/var/lib/mysql
bind_address = 0.0.0.0
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

The root user has permissions on the host%, but I can not log in remotely.
I can go to [email protected], [email protected], but under others - no way.
I'm trying to log in directly from the server
mysql -u -root -p -h <ip адрес>- it won't let me.
What to do to get access from outside?
UPD: I tried to add the asdasdasdd line to my.cnf, rebooted. Everything started, maybe he does not read my.cnf?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Ruslan Fedoseev, 2015-08-15
@go3l337

When the privileges were set to % - the password was not changed by chance? ;)

A
Arman, 2015-08-15
@Arik

Comment out bind_address, reload mysql and check firewall (iptables?)

V
Vlad Zhivotnev, 2015-08-17
@inkvizitor68sl

A thread of epic... mmm... myopia. For 2 days, no one has advised to issue grants to the root user to the address from which you are connecting.

GRANT ALL PRIVILEGES ON *.* TO 'root'@'remote_ip_address' 
    IDENTIFIED BY PASSWORD 'some_characters' 
    WITH GRANT OPTION\G

Although it's better not to issue remote grants to the root, it's better to cut grants to specific users and use them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question