MySQL Daemon Failed to Start - centos 6

前端 未结 16 2149
一整个雨季
一整个雨季 2020-12-14 02:44

EDIT: Look at the checkmarked answer comments to get your issue solved.

Whenever I try to start the SQLD service I get MySQL Daemon Failed to Start. I infact tried

16条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-14 03:00

    For those who will be here in the future, if all above methods are not working, check the my.cnf file by:

    $ sudo gedit /etc/my.cnf
    

    Find the line start with:

    bind-address=[an-IP-address]
    

    Check if the IP address after the equal sign is correct. If you don't even know what the IP is, just use localhost, then you can only connect to MySQL inside the same host.

    If you want to connect to MySQL remotely, you should actually comment out that line entirely, then it will listen on all IPs and ports which you need because you will be connecting remotely to it over public IPv4.

    After that add a user to access your database such as:

    mysql> GRANT ALL ON database_name.* TO user@xx.xxx.xx.xx IDENTIFIED BY 'your_password';
    

    Replace xx.xx.xx.xx with your local IP address of your laptop/desktop or if it is dynamic you can add them either by: '192.168.0.%' as a dynamic C-class or '%' if you want to be able to connect from anywhere (this is less secure)

    Also, if there's a firewall installed, one should open the port on the firewall;

    For example in Ubuntu:

    sudo ufw allow 3306/tcp
    sudo service ufw restart
    

    Now, check if the service is startable by:

    $ sudo service mysqld start
    

提交回复
热议问题