1

I'm trying to connect to mysql server running on fedora virtual machine. Connection is established. But when I've restarted mysql server with this command :

# /etc/init.d/mysqld restart 

stop is succeeded but start is failed!

I've tried with this command to start it but it's failed!

# /etc/init.d/mysqld start 

in the log file of mysql I had :

160509  13:09:58  [ERROR] /usr/libexec/mysqld: unknown variable 'bind-address 0.0.0.0'

160509 13:10:03 [ERROR] aborting

I've done some researches, I found that the solution is to uninstall mysql server and reinstall it, but I don't want to lose the data in my database. How can I fix this?

  • 1
    it looks to me like the contents of your mysql configuration file would be helpful to see -- particularly the lines around the "bind-address" text. The file is probably /etc/my.cnf – Jeff Schaller May 9 '16 at 15:17
  • based on this link it appears that the syntax wants to see "bind-address = 0.0.0.0" - where you are missing the equals-sign – Jeff Schaller May 9 '16 at 15:18
  • I'm guessing there is no = between bind-address and 0.0.0.0. This directive can be removed so the server listens to all interfaces. – Valentin Bajrami May 9 '16 at 15:18
  • 1
    Where did you get mysql from? Upstream project or somewhere else? Do you need it? Current Fedora ships with mariadb, which should be drop-in compatible. – mattdm May 9 '16 at 15:19
  • Where did you find the upstart scripts? What version of Fedora are you using? Fedora is using systemd for years now. – Jakuje May 9 '16 at 18:18
1

You can comment the bind-address in /etc/my.cnf:

#skip-networking
#bind-address                   = 127.0.0.1

also check that it is of the above format , var = value

if you are connecting to the database remotely , check your interface ip by using ip addr show or ifconfig command , get the ip and bind it to mysql.

   bind-address                   = your_ip

for example if you server ( on which mysql is installed ) has ip 192.168.1.1 then it should be:

  bind-address                   = 192.168.1.1 

for more details , see this article

  • thanks for your response , it works locally , but I'm connecting to database remotely when I uncommented this line #bind-address = 0.0.0.0 I lost Connection from the distant machine ! – pietà May 9 '16 at 15:34
  • answer updated , you can bind your interface ip to mysql – Ijaz Ahmad Khan May 9 '16 at 15:40
  • I've made these changes bind-address= 192.168.1.5 , I saved and I retarted : /etc/init.d/mysqld restart stop is done but start is failed again ! when i comment #bind-address it's strated .. what maybe the problem here ? – pietà May 9 '16 at 15:55
  • check your logs and make sure the syntax is correct – Ijaz Ahmad Khan May 9 '16 at 16:01
  • No need for bind-address option even if you connect remotely. – Lev Bystritskiy May 9 '16 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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