Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question
add comment

4 Answers 4

up vote 1 down vote accepted

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

share|improve this answer
    
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
add comment

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

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

[mysqld]
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 = 172.20.5.2
# skip-networking

Restart with:

service mysqld restart

or

/etc/init.d/mysqld restart
share|improve this answer
add comment

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?

share|improve this answer
add comment

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

"user=mysql"

to

"user=root"
share|improve this answer
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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