I need to remove skip-networking from MySQL startup parameters

I am running MySQL on Linux on Centos on a VPS

Can someone please tell a newbie how to do this ?

I suppose to start and stop the mySQL server, I have to do something like this
/etc/init.d/mysqld stop
/etc/init.d/mysqld start

# ps -ef|grep 'mysql'  
root     11331 20220  0 10:53 pts/0    00:00:00 grep mysql  
root     32452     1  0 Apr02 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe --skip-grant-tables --skip-networking  
mysql    32504 32452  0 Apr02 ?        00:00:18 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --socket=/var/lib/mysql/mysql.sock --skip-grant-tables --skip-networking

Open up the /etc/init.d/mysqld script, find the --skip-networking parameter and remove it.

  • 1
    Just checked. That file doesn't have this parameter – RN. Apr 3 '10 at 15:05
  • Try running this query SHOW VARIABLES LIKE 'skip_networking';. If it's set to ON you might not have your port configured in the my.cnf. – gekkz Apr 3 '10 at 15:18
  • It is ON. Checked my /etc/my.cnf. It doesn't have a port defined. Basically, I am trying to troubleshoot serverfault.com/questions/129038/… – RN. Apr 3 '10 at 15:23
  • Add port = 3306 in my.cnf and bind-address = YOUR_IP and try again. – gekkz Apr 3 '10 at 15:29
  • All I did was add the port to my.cnf. Did not add bind-address. – RN. Apr 4 '10 at 16:06

comment the "skip-networking" directive in /etc/my.cnf and restart mysqld.

You can specify other networking related directives in my.cnf, Example:

user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/English
bind-address =
# skip-networking

Restart with:

service mysqld restart


/etc/init.d/mysqld restart

Follow the white rabbit. At some point, originating from /etc/init.d/mysqld, some script must append the parameter. If existing, check /usr/bin/mysqld_safe. Also look at included files in these scripts.

Maybe we're tampering with a security measure here. Does CentOS add this line unless a password has been set for the mysql root user?


I suppose you are also trying it as root. I got the same problem, and this tweak helped me:

Change this line in /etc/my.cnf



  • 2
    It's really bad advice. You should avoid running daemons as root for secuirty reasons. – sumar May 20 '10 at 7:06
  • agreed... but this is b'coz of the conflict in new MySQL Release and User Permission... And the Person here most probably is trying that as ROOT So, i replied the least confusing reply where he/she wouldn't have to change anything else he/she is doing ................... otherwise he/she could login as the new 'mysql' gets created and do the changing... or change the "user=root" with any low-priority user to access it – AbhishekKr May 20 '10 at 14:00

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.