Set mysql skip-networking to off

I am trying to configure my Ubuntu 12.10 server to accept remote mysql connections, however I am having difficulty disabling skip-networking. Note. I have already set the Internet binding address that is facing IP, instead of 127.0.0.1.

When I look in /etc/mysql/my.conf, the line "skip-networking" does not exist, but when I do "mysql -p -u root" and then "SHOW VARIABLES"; "skip-networking" - "ON". I added it as "# skip-networking" and restarted the mysql service.

I looked to see if there were any stray my.conf and / etc / files in my home folder so that no luck.

I am using mysql 5.5.

Anyone have any ideas how else can I install this?

+4
source share
5 answers

Read the chapter Using Additional Files for some tips on how to find the settings file. If the guys from Ubuntu did not decide to change it, the file was always named my.cnfin Linux, never my.conf.

Also, lines starting with #are comments:

#comment, ;comment

Comment lines begin with "#" or ";". The comment "#" may begin in the middle of the line.

... so you need to remove the lead #; otherwise, the string is ignored.

+2
source

Put "--skip_networking = 0" on the mysql command line.

, , , , , , "networkinng", .: -)

. Mine : "150213 17:57:10 [ERROR]/opt/local/lib/mariadb-10.1/bin/mysqld: " skip_networkinng = 0 " " skip_networking = OFF", .

, Ubuntu, Mac OS /System/Library/LaunchDaemons/org.mysql.mysqld(, LaunchDaemons, ):

<key>ProgramArguments</key>
    <array>
        <string>/opt/local/lib/mariadb-10.1/bin/mysqld</string>
        <string>--skip_networking=0</string>
        <string>--socket=/opt/local/var/run/mariadb-10.1/mysqld.sock</string>
        <string>--user=mysql</string>
        <string>--port=3306</string>
        <string>--datadir=/opt/local/var/db/mariadb-10.1</string>
        <string>--pid-file=/opt/local/var/run/mariadb-10.1/dns.local.pid</string>
    </array>

(, ..)

, ! , ! !

+3

, , , , .

:

  • (ps auxf | grep 'mysql[d]'), , --skip-networking - .

  • , mysqld 3306 ( , ): netstat -lnp46 | grep -w 3306

  • ip-, , ip, .

  • , , iptables ip6tables - iptables-save ip6tables-save, iptables -L ip6tables -L, (raw, nat, mangle ..).

+2

.
, mysqld_safe .
" {PID}", . (mysqld_safe PID).
, , pkill mysqld , mysqld.

+1

In my case for Ubuntu 18.04 & mysql 5.7, it was not in the file "my.cnf", but with the command below

sudo grep -rnw '/etc/' -e 'skip-networking'

I found this in a file /etc/systemd/system/mysql.service.d/override.conf.

0
source

Source: https://habr.com/ru/post/1530845/


All Articles