Cann't start MySQL on my Linux server with Centos 7 OS












0















I have already installed MySQL in a Server (Centos 7) by the following commands:



yum install -y mysql
yum install -y mysql-server
yum install -y mysql-devel


After the installation, I type mysql and meet the error



ERROR 2002 (HY000): Can't connect to local MySQL server through socket 
'/var/mysql/mysql.sock' (2)


I think it is because I didn't started the MySQL service yet, so I type the command



service mysqld start


Then I get the message said that Job for mariadb.service failed



Here is the content of /etc/my.cnf



[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid


However, the file /var/lib/mysql/mysql.sock is not existed in my server. BTW, SELINUX is disabled manually.



mariadb.log shows



InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
InnoDB: Possible causes for this error:
(a) Incorrect log file is used or log file size is changed
(b) In case default size is used this log file is from 10.0
(c) Log file is corrupted or there was not enough disk space
In case (b) you need to set innodb_log_file_size = 48M
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGIN failed.
[ERROR] Unknown/unsupported storage engine: innodb
[ERROR] Aborting









share|improve this question




















  • 1





    stopdisablingselinux.com There is no need to disable SELinux. Certainly straight out of the box, services installed from official repos and no exotic config services will work the way you expect with SELinux enabled. Please add the errors reported in /var/log/mariadb/mariadb.log to your question. The mysql.sock will be created when Mysql is started. Is this a clean install or did you have a MySQL DB before this on this system?

    – Bram
    Nov 6 '15 at 11:51











  • Thanks for your remind and I attached some messages of mariadb.log. It is a clean system with MySQL installed for the first time.

    – foool
    Nov 6 '15 at 12:34











  • So? Did you check disk space? Size of the file and the contents of the conf file?

    – Bram
    Nov 6 '15 at 12:38
















0















I have already installed MySQL in a Server (Centos 7) by the following commands:



yum install -y mysql
yum install -y mysql-server
yum install -y mysql-devel


After the installation, I type mysql and meet the error



ERROR 2002 (HY000): Can't connect to local MySQL server through socket 
'/var/mysql/mysql.sock' (2)


I think it is because I didn't started the MySQL service yet, so I type the command



service mysqld start


Then I get the message said that Job for mariadb.service failed



Here is the content of /etc/my.cnf



[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid


However, the file /var/lib/mysql/mysql.sock is not existed in my server. BTW, SELINUX is disabled manually.



mariadb.log shows



InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
InnoDB: Possible causes for this error:
(a) Incorrect log file is used or log file size is changed
(b) In case default size is used this log file is from 10.0
(c) Log file is corrupted or there was not enough disk space
In case (b) you need to set innodb_log_file_size = 48M
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGIN failed.
[ERROR] Unknown/unsupported storage engine: innodb
[ERROR] Aborting









share|improve this question




















  • 1





    stopdisablingselinux.com There is no need to disable SELinux. Certainly straight out of the box, services installed from official repos and no exotic config services will work the way you expect with SELinux enabled. Please add the errors reported in /var/log/mariadb/mariadb.log to your question. The mysql.sock will be created when Mysql is started. Is this a clean install or did you have a MySQL DB before this on this system?

    – Bram
    Nov 6 '15 at 11:51











  • Thanks for your remind and I attached some messages of mariadb.log. It is a clean system with MySQL installed for the first time.

    – foool
    Nov 6 '15 at 12:34











  • So? Did you check disk space? Size of the file and the contents of the conf file?

    – Bram
    Nov 6 '15 at 12:38














0












0








0








I have already installed MySQL in a Server (Centos 7) by the following commands:



yum install -y mysql
yum install -y mysql-server
yum install -y mysql-devel


After the installation, I type mysql and meet the error



ERROR 2002 (HY000): Can't connect to local MySQL server through socket 
'/var/mysql/mysql.sock' (2)


I think it is because I didn't started the MySQL service yet, so I type the command



service mysqld start


Then I get the message said that Job for mariadb.service failed



Here is the content of /etc/my.cnf



[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid


However, the file /var/lib/mysql/mysql.sock is not existed in my server. BTW, SELINUX is disabled manually.



mariadb.log shows



InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
InnoDB: Possible causes for this error:
(a) Incorrect log file is used or log file size is changed
(b) In case default size is used this log file is from 10.0
(c) Log file is corrupted or there was not enough disk space
In case (b) you need to set innodb_log_file_size = 48M
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGIN failed.
[ERROR] Unknown/unsupported storage engine: innodb
[ERROR] Aborting









share|improve this question
















I have already installed MySQL in a Server (Centos 7) by the following commands:



yum install -y mysql
yum install -y mysql-server
yum install -y mysql-devel


After the installation, I type mysql and meet the error



ERROR 2002 (HY000): Can't connect to local MySQL server through socket 
'/var/mysql/mysql.sock' (2)


I think it is because I didn't started the MySQL service yet, so I type the command



service mysqld start


Then I get the message said that Job for mariadb.service failed



Here is the content of /etc/my.cnf



[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid


However, the file /var/lib/mysql/mysql.sock is not existed in my server. BTW, SELINUX is disabled manually.



mariadb.log shows



InnoDB: Error: log file ./ib_logfile0 is of different size 0 50331648 bytes
InnoDB: than specified in the .cnf file 0 5242880 bytes!
InnoDB: Possible causes for this error:
(a) Incorrect log file is used or log file size is changed
(b) In case default size is used this log file is from 10.0
(c) Log file is corrupted or there was not enough disk space
In case (b) you need to set innodb_log_file_size = 48M
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGIN failed.
[ERROR] Unknown/unsupported storage engine: innodb
[ERROR] Aborting






centos mysql






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 6 '15 at 12:21







foool

















asked Nov 6 '15 at 11:08









fooolfoool

1014




1014








  • 1





    stopdisablingselinux.com There is no need to disable SELinux. Certainly straight out of the box, services installed from official repos and no exotic config services will work the way you expect with SELinux enabled. Please add the errors reported in /var/log/mariadb/mariadb.log to your question. The mysql.sock will be created when Mysql is started. Is this a clean install or did you have a MySQL DB before this on this system?

    – Bram
    Nov 6 '15 at 11:51











  • Thanks for your remind and I attached some messages of mariadb.log. It is a clean system with MySQL installed for the first time.

    – foool
    Nov 6 '15 at 12:34











  • So? Did you check disk space? Size of the file and the contents of the conf file?

    – Bram
    Nov 6 '15 at 12:38














  • 1





    stopdisablingselinux.com There is no need to disable SELinux. Certainly straight out of the box, services installed from official repos and no exotic config services will work the way you expect with SELinux enabled. Please add the errors reported in /var/log/mariadb/mariadb.log to your question. The mysql.sock will be created when Mysql is started. Is this a clean install or did you have a MySQL DB before this on this system?

    – Bram
    Nov 6 '15 at 11:51











  • Thanks for your remind and I attached some messages of mariadb.log. It is a clean system with MySQL installed for the first time.

    – foool
    Nov 6 '15 at 12:34











  • So? Did you check disk space? Size of the file and the contents of the conf file?

    – Bram
    Nov 6 '15 at 12:38








1




1





stopdisablingselinux.com There is no need to disable SELinux. Certainly straight out of the box, services installed from official repos and no exotic config services will work the way you expect with SELinux enabled. Please add the errors reported in /var/log/mariadb/mariadb.log to your question. The mysql.sock will be created when Mysql is started. Is this a clean install or did you have a MySQL DB before this on this system?

– Bram
Nov 6 '15 at 11:51





stopdisablingselinux.com There is no need to disable SELinux. Certainly straight out of the box, services installed from official repos and no exotic config services will work the way you expect with SELinux enabled. Please add the errors reported in /var/log/mariadb/mariadb.log to your question. The mysql.sock will be created when Mysql is started. Is this a clean install or did you have a MySQL DB before this on this system?

– Bram
Nov 6 '15 at 11:51













Thanks for your remind and I attached some messages of mariadb.log. It is a clean system with MySQL installed for the first time.

– foool
Nov 6 '15 at 12:34





Thanks for your remind and I attached some messages of mariadb.log. It is a clean system with MySQL installed for the first time.

– foool
Nov 6 '15 at 12:34













So? Did you check disk space? Size of the file and the contents of the conf file?

– Bram
Nov 6 '15 at 12:38





So? Did you check disk space? Size of the file and the contents of the conf file?

– Bram
Nov 6 '15 at 12:38










1 Answer
1






active

oldest

votes


















0














I fixed this problem, so I want to answer it myself. If this self-answering behavior is not appropriate, please make comments below.



Overall, I solve this problem by figuring issues listed in /var/log/mariadb/maridb.log file.



First, I remove the ./ib_logfile0, which is pointed out beyond size limitation in the log file. Then, I try to enable + start mariadb with systemctl, fail again. maridb.log says Incorrect information in file './mysql/proxies_priv.frm'. By backuping the incorrect file and restarting the mysql, the maridb is finally OK.






share|improve this answer
























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f241208%2fcannt-start-mysql-on-my-linux-server-with-centos-7-os%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I fixed this problem, so I want to answer it myself. If this self-answering behavior is not appropriate, please make comments below.



    Overall, I solve this problem by figuring issues listed in /var/log/mariadb/maridb.log file.



    First, I remove the ./ib_logfile0, which is pointed out beyond size limitation in the log file. Then, I try to enable + start mariadb with systemctl, fail again. maridb.log says Incorrect information in file './mysql/proxies_priv.frm'. By backuping the incorrect file and restarting the mysql, the maridb is finally OK.






    share|improve this answer




























      0














      I fixed this problem, so I want to answer it myself. If this self-answering behavior is not appropriate, please make comments below.



      Overall, I solve this problem by figuring issues listed in /var/log/mariadb/maridb.log file.



      First, I remove the ./ib_logfile0, which is pointed out beyond size limitation in the log file. Then, I try to enable + start mariadb with systemctl, fail again. maridb.log says Incorrect information in file './mysql/proxies_priv.frm'. By backuping the incorrect file and restarting the mysql, the maridb is finally OK.






      share|improve this answer


























        0












        0








        0







        I fixed this problem, so I want to answer it myself. If this self-answering behavior is not appropriate, please make comments below.



        Overall, I solve this problem by figuring issues listed in /var/log/mariadb/maridb.log file.



        First, I remove the ./ib_logfile0, which is pointed out beyond size limitation in the log file. Then, I try to enable + start mariadb with systemctl, fail again. maridb.log says Incorrect information in file './mysql/proxies_priv.frm'. By backuping the incorrect file and restarting the mysql, the maridb is finally OK.






        share|improve this answer













        I fixed this problem, so I want to answer it myself. If this self-answering behavior is not appropriate, please make comments below.



        Overall, I solve this problem by figuring issues listed in /var/log/mariadb/maridb.log file.



        First, I remove the ./ib_logfile0, which is pointed out beyond size limitation in the log file. Then, I try to enable + start mariadb with systemctl, fail again. maridb.log says Incorrect information in file './mysql/proxies_priv.frm'. By backuping the incorrect file and restarting the mysql, the maridb is finally OK.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 6 '15 at 13:55









        fooolfoool

        1014




        1014






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f241208%2fcannt-start-mysql-on-my-linux-server-with-centos-7-os%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

            is 'sed' thread safe

            How to make a Squid Proxy server?