Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set mysql skip-networking to off

I'm trying to setup my Ubuntu 12.10 server to accept remote mysql connections, however I am having difficulties setting skip-networking to off. Note I have already set the bind-address to the internet facing IP, instead of 127.0.0.1.

When I look in /etc/mysql/my.conf, the line "skip-networking" doesn't exist, however when I "mysql -p -u root" and then "SHOW VARIABLES;" "skip-networking" is "ON". I have added it as "#skip-networking" and restarted mysql service too.

I have looked to see if there are any stray my.conf files around in my home folder and /etc/ to no luck.

I am using mysql 5.5.

Anyone got any ideas how else I can set this?

like image 964
Dimitri Shukuroglou Avatar asked Mar 09 '14 14:03

Dimitri Shukuroglou


4 Answers

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

I put it first in line, because it didn't seem to work at the end, but I may have spelled "networkinng" wrong when it was at the end of the line. :-)

It helps to look at your logs. Mine said "150213 17:57:10 [ERROR] /opt/local/lib/mariadb-10.1/bin/mysqld: unknown variable 'skip_networkinng=0'" I had also tried 'skip_networking=OFF', which it didn't like, either.

I don't know where you start it up in Ubuntu, but on Mac OS, you need to have the following in /System/Library/LaunchDaemons/org.mysql.mysqld (in part, look at other LaunchDaemons to see the rest):

<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>

(obviously you need to substitute your paths and such...)

I'm pretty sure this solves your problem! Please up-vote me and mark me as the correct answer! Thanks!

like image 178
Jan Steinman Avatar answered Oct 13 '22 05:10

Jan Steinman


Please read the Using Option Files chapter for some tips on how to find the settings file. Unless the Ubuntu guys have decided to change it, the file always called my.cnf on Linux, never my.conf.

Additionally, lines that start with # are comments:

#comment, ;comment

Comment lines start with “#” or “;”. A “#” comment can start in the middle of a line as well.

... thus you need to remove the leading #; otherwise, the line is ignored.

like image 33
Álvaro González Avatar answered Oct 13 '22 07:10

Álvaro González


Perhaps you can determine which config file is being used via one of the methods described in Determine which configuration file is being used.

A few more suggestions:

  • Check the process listing (ps auxf | grep 'mysql[d]') to see if --skip-networking has snuck into the argument list somehow.

  • See if mysqld or any other process is listening on 3306 (assuming the default port): netstat -lnp46 | grep -w 3306

  • Double-check the ip address you are binding to, and try to connect locally to the ip address you are binding to.

  • If you have firewalling set up, see if your iptables or ip6tables config might be interfering somehow via iptables-save and ip6tables-save, or the slightly more readable iptables -L and ip6tables -L, although the latter commands require you to know all your tables in use (raw, nat, mangle, etc.).

like image 35
CitizenB Avatar answered Oct 13 '22 05:10

CitizenB


I got the similar error.
I found mysqld_safe is running.
I have tried 'kill {PID}', but it doesn't work. (mysqld_safe would restart with different PID).
Finally, I found pkill mysqld do the work, and it won't hurt your running mysqld service.

like image 45
Weijing Jay Lin Avatar answered Oct 13 '22 05:10

Weijing Jay Lin