Can't start MySQL to reset root password












0















I've installed mysql-server on a Linux box and forgot (oops) the root password. Having looked around the internet, the general method is so:




  1. Stop MySQL (sudo service mysql stop)

  2. Start MySQL in special mode (sudo mysqld_safe --skip-grant-tables)

  3. Login to local server and reset password (mysql -u root)


My problem is at number 2. When I run the command, it says some stuff about logging and starting the daemon, then ends with the line



mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended


and using sudo service mysql status confirms that MySQL has, indeed stopped.



Why does it stop so suddenly? And (more importantly) how can I get it to keep running so I can reset my password?



Thanks in advance



EDIT Here's the full log of "stuff about loggin and starting the daemon":



$ mysqld_safe --skip-grant-tables 
141219 16:55:20 mysqld_safe Logging to syslog.
141219 16:55:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141219 16:55:20 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
$


EDIT 2 And the output of /var/log/syslog (I've replaced my hostname with <hostname>)



Dec 20 10:20:09 <hostname> mysqld_safe: Starting mysqld daemon with databases from /var/lib/mysql
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Warning] Can't create test file /var/lib/mysql/<hostname>.lower-test
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Warning] Can't create test file /var/lib/mysql/<hostname>.lower-test
Dec 20 10:20:09 <hostname> mysqld: #007/usr/sbin/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13)
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [ERROR] Aborting
Dec 20 10:20:09 <hostname> mysqld:
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Note] /usr/sbin/mysqld: Shutdown complete
Dec 20 10:20:09 <hostname> mysqld:
Dec 20 10:20:09 <hostname> mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended









share|improve this question

























  • Please can you add all of the "stuff about logging and starting the daemon" to the question. It's not possible to diagnose a problem if you edit out all of the diagnostic information.

    – Mike Scott
    Dec 19 '14 at 16:30













  • OK, thanks for that data. Now can you look in syslog to see what it's logged there?

    – Mike Scott
    Dec 19 '14 at 17:59











  • Where do I access syslog?

    – Luke Moll
    Dec 19 '14 at 20:21











  • I'm afraid that depends on how you've configured your system, but you could look for /var/syslog.

    – Mike Scott
    Dec 19 '14 at 21:11











  • It was in /var/log/syslog, I've re-run the command to get the output as it looks like syslog only keeps the most recent messages.

    – Luke Moll
    Dec 20 '14 at 10:30
















0















I've installed mysql-server on a Linux box and forgot (oops) the root password. Having looked around the internet, the general method is so:




  1. Stop MySQL (sudo service mysql stop)

  2. Start MySQL in special mode (sudo mysqld_safe --skip-grant-tables)

  3. Login to local server and reset password (mysql -u root)


My problem is at number 2. When I run the command, it says some stuff about logging and starting the daemon, then ends with the line



mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended


and using sudo service mysql status confirms that MySQL has, indeed stopped.



Why does it stop so suddenly? And (more importantly) how can I get it to keep running so I can reset my password?



Thanks in advance



EDIT Here's the full log of "stuff about loggin and starting the daemon":



$ mysqld_safe --skip-grant-tables 
141219 16:55:20 mysqld_safe Logging to syslog.
141219 16:55:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141219 16:55:20 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
$


EDIT 2 And the output of /var/log/syslog (I've replaced my hostname with <hostname>)



Dec 20 10:20:09 <hostname> mysqld_safe: Starting mysqld daemon with databases from /var/lib/mysql
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Warning] Can't create test file /var/lib/mysql/<hostname>.lower-test
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Warning] Can't create test file /var/lib/mysql/<hostname>.lower-test
Dec 20 10:20:09 <hostname> mysqld: #007/usr/sbin/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13)
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [ERROR] Aborting
Dec 20 10:20:09 <hostname> mysqld:
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Note] /usr/sbin/mysqld: Shutdown complete
Dec 20 10:20:09 <hostname> mysqld:
Dec 20 10:20:09 <hostname> mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended









share|improve this question

























  • Please can you add all of the "stuff about logging and starting the daemon" to the question. It's not possible to diagnose a problem if you edit out all of the diagnostic information.

    – Mike Scott
    Dec 19 '14 at 16:30













  • OK, thanks for that data. Now can you look in syslog to see what it's logged there?

    – Mike Scott
    Dec 19 '14 at 17:59











  • Where do I access syslog?

    – Luke Moll
    Dec 19 '14 at 20:21











  • I'm afraid that depends on how you've configured your system, but you could look for /var/syslog.

    – Mike Scott
    Dec 19 '14 at 21:11











  • It was in /var/log/syslog, I've re-run the command to get the output as it looks like syslog only keeps the most recent messages.

    – Luke Moll
    Dec 20 '14 at 10:30














0












0








0








I've installed mysql-server on a Linux box and forgot (oops) the root password. Having looked around the internet, the general method is so:




  1. Stop MySQL (sudo service mysql stop)

  2. Start MySQL in special mode (sudo mysqld_safe --skip-grant-tables)

  3. Login to local server and reset password (mysql -u root)


My problem is at number 2. When I run the command, it says some stuff about logging and starting the daemon, then ends with the line



mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended


and using sudo service mysql status confirms that MySQL has, indeed stopped.



Why does it stop so suddenly? And (more importantly) how can I get it to keep running so I can reset my password?



Thanks in advance



EDIT Here's the full log of "stuff about loggin and starting the daemon":



$ mysqld_safe --skip-grant-tables 
141219 16:55:20 mysqld_safe Logging to syslog.
141219 16:55:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141219 16:55:20 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
$


EDIT 2 And the output of /var/log/syslog (I've replaced my hostname with <hostname>)



Dec 20 10:20:09 <hostname> mysqld_safe: Starting mysqld daemon with databases from /var/lib/mysql
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Warning] Can't create test file /var/lib/mysql/<hostname>.lower-test
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Warning] Can't create test file /var/lib/mysql/<hostname>.lower-test
Dec 20 10:20:09 <hostname> mysqld: #007/usr/sbin/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13)
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [ERROR] Aborting
Dec 20 10:20:09 <hostname> mysqld:
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Note] /usr/sbin/mysqld: Shutdown complete
Dec 20 10:20:09 <hostname> mysqld:
Dec 20 10:20:09 <hostname> mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended









share|improve this question
















I've installed mysql-server on a Linux box and forgot (oops) the root password. Having looked around the internet, the general method is so:




  1. Stop MySQL (sudo service mysql stop)

  2. Start MySQL in special mode (sudo mysqld_safe --skip-grant-tables)

  3. Login to local server and reset password (mysql -u root)


My problem is at number 2. When I run the command, it says some stuff about logging and starting the daemon, then ends with the line



mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended


and using sudo service mysql status confirms that MySQL has, indeed stopped.



Why does it stop so suddenly? And (more importantly) how can I get it to keep running so I can reset my password?



Thanks in advance



EDIT Here's the full log of "stuff about loggin and starting the daemon":



$ mysqld_safe --skip-grant-tables 
141219 16:55:20 mysqld_safe Logging to syslog.
141219 16:55:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141219 16:55:20 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
$


EDIT 2 And the output of /var/log/syslog (I've replaced my hostname with <hostname>)



Dec 20 10:20:09 <hostname> mysqld_safe: Starting mysqld daemon with databases from /var/lib/mysql
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Warning] Can't create test file /var/lib/mysql/<hostname>.lower-test
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Warning] Can't create test file /var/lib/mysql/<hostname>.lower-test
Dec 20 10:20:09 <hostname> mysqld: #007/usr/sbin/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 13)
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [ERROR] Aborting
Dec 20 10:20:09 <hostname> mysqld:
Dec 20 10:20:09 <hostname> mysqld: 141220 10:20:09 [Note] /usr/sbin/mysqld: Shutdown complete
Dec 20 10:20:09 <hostname> mysqld:
Dec 20 10:20:09 <hostname> mysqld_safe: mysqld from pid file /var/run/mysqld/mysqld.pid ended






linux mysql password-recovery daemon






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 20 '14 at 10:26







Luke Moll

















asked Dec 19 '14 at 16:17









Luke MollLuke Moll

12318




12318













  • Please can you add all of the "stuff about logging and starting the daemon" to the question. It's not possible to diagnose a problem if you edit out all of the diagnostic information.

    – Mike Scott
    Dec 19 '14 at 16:30













  • OK, thanks for that data. Now can you look in syslog to see what it's logged there?

    – Mike Scott
    Dec 19 '14 at 17:59











  • Where do I access syslog?

    – Luke Moll
    Dec 19 '14 at 20:21











  • I'm afraid that depends on how you've configured your system, but you could look for /var/syslog.

    – Mike Scott
    Dec 19 '14 at 21:11











  • It was in /var/log/syslog, I've re-run the command to get the output as it looks like syslog only keeps the most recent messages.

    – Luke Moll
    Dec 20 '14 at 10:30



















  • Please can you add all of the "stuff about logging and starting the daemon" to the question. It's not possible to diagnose a problem if you edit out all of the diagnostic information.

    – Mike Scott
    Dec 19 '14 at 16:30













  • OK, thanks for that data. Now can you look in syslog to see what it's logged there?

    – Mike Scott
    Dec 19 '14 at 17:59











  • Where do I access syslog?

    – Luke Moll
    Dec 19 '14 at 20:21











  • I'm afraid that depends on how you've configured your system, but you could look for /var/syslog.

    – Mike Scott
    Dec 19 '14 at 21:11











  • It was in /var/log/syslog, I've re-run the command to get the output as it looks like syslog only keeps the most recent messages.

    – Luke Moll
    Dec 20 '14 at 10:30

















Please can you add all of the "stuff about logging and starting the daemon" to the question. It's not possible to diagnose a problem if you edit out all of the diagnostic information.

– Mike Scott
Dec 19 '14 at 16:30







Please can you add all of the "stuff about logging and starting the daemon" to the question. It's not possible to diagnose a problem if you edit out all of the diagnostic information.

– Mike Scott
Dec 19 '14 at 16:30















OK, thanks for that data. Now can you look in syslog to see what it's logged there?

– Mike Scott
Dec 19 '14 at 17:59





OK, thanks for that data. Now can you look in syslog to see what it's logged there?

– Mike Scott
Dec 19 '14 at 17:59













Where do I access syslog?

– Luke Moll
Dec 19 '14 at 20:21





Where do I access syslog?

– Luke Moll
Dec 19 '14 at 20:21













I'm afraid that depends on how you've configured your system, but you could look for /var/syslog.

– Mike Scott
Dec 19 '14 at 21:11





I'm afraid that depends on how you've configured your system, but you could look for /var/syslog.

– Mike Scott
Dec 19 '14 at 21:11













It was in /var/log/syslog, I've re-run the command to get the output as it looks like syslog only keeps the most recent messages.

– Luke Moll
Dec 20 '14 at 10:30





It was in /var/log/syslog, I've re-run the command to get the output as it looks like syslog only keeps the most recent messages.

– Luke Moll
Dec 20 '14 at 10:30










3 Answers
3






active

oldest

votes


















0














OK, it looks like either /var/lib/mysql doesn't exist or the mysql user doesn't have permission to access it. Either way, you have worse problems than having forgotten the root password -- either you don't have a database at all, or something has changed the file permissions or ownership.






share|improve this answer
























  • Would reinstalling mysql-server help?

    – Luke Moll
    Dec 20 '14 at 17:41











  • Probably, yes, if you don't have any data that you want to keep.

    – Mike Scott
    Dec 20 '14 at 18:45











  • No idea what the problem was, but ran #apt-get purge mysql-server mysql-server-5.5 mysql-core-5.5 and then reinstalled MySQL server (making sure to write down the password :D)

    – Luke Moll
    Dec 23 '14 at 23:36



















1














This issue might be caused due to several issue. You can find the exact error from "tail /var/log/mysql/error.log". I have added the default fix for these kind of issues. If the below is not working then update us the print from log where we can try to get some info and move further



Kill all the MySQL process using the following command.



ps aux | grep mysql kill pid


Find the path of mysqld daemon using the "which mysqld_safe" command



Start MySQL without grant tables from the mysqld_safe location



/mysqld_safe_available_directory/mysqld_safe --skip-grant-tables &


ex /bin/mysqld_safe



mysql -u root 


Steps to set the new password:



use mysql;
update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
flush privileges;
quit





share|improve this answer
























  • Gave it a try but $ ps aux | grep mysql kill pid gives grep: kill: No such file or directory grep: pid: No such file or directory, then rest of steps same problem as question (... pid ended). When I tried just ps aux | grep mysql then kill (pid) where pid it the number in the pid column, it says No such process.

    – Luke Moll
    Dec 19 '14 at 16:50





















0














I faced same problem
Aborting come from permission on /var/lib/mysql
the folder belong to user mysql, then root has no fully access



solved it by:



$ sudo su - mysql

$ mysqld_safe --skip-grant-tables &





share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    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: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2fsuperuser.com%2fquestions%2f854637%2fcant-start-mysql-to-reset-root-password%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    OK, it looks like either /var/lib/mysql doesn't exist or the mysql user doesn't have permission to access it. Either way, you have worse problems than having forgotten the root password -- either you don't have a database at all, or something has changed the file permissions or ownership.






    share|improve this answer
























    • Would reinstalling mysql-server help?

      – Luke Moll
      Dec 20 '14 at 17:41











    • Probably, yes, if you don't have any data that you want to keep.

      – Mike Scott
      Dec 20 '14 at 18:45











    • No idea what the problem was, but ran #apt-get purge mysql-server mysql-server-5.5 mysql-core-5.5 and then reinstalled MySQL server (making sure to write down the password :D)

      – Luke Moll
      Dec 23 '14 at 23:36
















    0














    OK, it looks like either /var/lib/mysql doesn't exist or the mysql user doesn't have permission to access it. Either way, you have worse problems than having forgotten the root password -- either you don't have a database at all, or something has changed the file permissions or ownership.






    share|improve this answer
























    • Would reinstalling mysql-server help?

      – Luke Moll
      Dec 20 '14 at 17:41











    • Probably, yes, if you don't have any data that you want to keep.

      – Mike Scott
      Dec 20 '14 at 18:45











    • No idea what the problem was, but ran #apt-get purge mysql-server mysql-server-5.5 mysql-core-5.5 and then reinstalled MySQL server (making sure to write down the password :D)

      – Luke Moll
      Dec 23 '14 at 23:36














    0












    0








    0







    OK, it looks like either /var/lib/mysql doesn't exist or the mysql user doesn't have permission to access it. Either way, you have worse problems than having forgotten the root password -- either you don't have a database at all, or something has changed the file permissions or ownership.






    share|improve this answer













    OK, it looks like either /var/lib/mysql doesn't exist or the mysql user doesn't have permission to access it. Either way, you have worse problems than having forgotten the root password -- either you don't have a database at all, or something has changed the file permissions or ownership.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 20 '14 at 13:10









    Mike ScottMike Scott

    4,1001217




    4,1001217













    • Would reinstalling mysql-server help?

      – Luke Moll
      Dec 20 '14 at 17:41











    • Probably, yes, if you don't have any data that you want to keep.

      – Mike Scott
      Dec 20 '14 at 18:45











    • No idea what the problem was, but ran #apt-get purge mysql-server mysql-server-5.5 mysql-core-5.5 and then reinstalled MySQL server (making sure to write down the password :D)

      – Luke Moll
      Dec 23 '14 at 23:36



















    • Would reinstalling mysql-server help?

      – Luke Moll
      Dec 20 '14 at 17:41











    • Probably, yes, if you don't have any data that you want to keep.

      – Mike Scott
      Dec 20 '14 at 18:45











    • No idea what the problem was, but ran #apt-get purge mysql-server mysql-server-5.5 mysql-core-5.5 and then reinstalled MySQL server (making sure to write down the password :D)

      – Luke Moll
      Dec 23 '14 at 23:36

















    Would reinstalling mysql-server help?

    – Luke Moll
    Dec 20 '14 at 17:41





    Would reinstalling mysql-server help?

    – Luke Moll
    Dec 20 '14 at 17:41













    Probably, yes, if you don't have any data that you want to keep.

    – Mike Scott
    Dec 20 '14 at 18:45





    Probably, yes, if you don't have any data that you want to keep.

    – Mike Scott
    Dec 20 '14 at 18:45













    No idea what the problem was, but ran #apt-get purge mysql-server mysql-server-5.5 mysql-core-5.5 and then reinstalled MySQL server (making sure to write down the password :D)

    – Luke Moll
    Dec 23 '14 at 23:36





    No idea what the problem was, but ran #apt-get purge mysql-server mysql-server-5.5 mysql-core-5.5 and then reinstalled MySQL server (making sure to write down the password :D)

    – Luke Moll
    Dec 23 '14 at 23:36













    1














    This issue might be caused due to several issue. You can find the exact error from "tail /var/log/mysql/error.log". I have added the default fix for these kind of issues. If the below is not working then update us the print from log where we can try to get some info and move further



    Kill all the MySQL process using the following command.



    ps aux | grep mysql kill pid


    Find the path of mysqld daemon using the "which mysqld_safe" command



    Start MySQL without grant tables from the mysqld_safe location



    /mysqld_safe_available_directory/mysqld_safe --skip-grant-tables &


    ex /bin/mysqld_safe



    mysql -u root 


    Steps to set the new password:



    use mysql;
    update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
    flush privileges;
    quit





    share|improve this answer
























    • Gave it a try but $ ps aux | grep mysql kill pid gives grep: kill: No such file or directory grep: pid: No such file or directory, then rest of steps same problem as question (... pid ended). When I tried just ps aux | grep mysql then kill (pid) where pid it the number in the pid column, it says No such process.

      – Luke Moll
      Dec 19 '14 at 16:50


















    1














    This issue might be caused due to several issue. You can find the exact error from "tail /var/log/mysql/error.log". I have added the default fix for these kind of issues. If the below is not working then update us the print from log where we can try to get some info and move further



    Kill all the MySQL process using the following command.



    ps aux | grep mysql kill pid


    Find the path of mysqld daemon using the "which mysqld_safe" command



    Start MySQL without grant tables from the mysqld_safe location



    /mysqld_safe_available_directory/mysqld_safe --skip-grant-tables &


    ex /bin/mysqld_safe



    mysql -u root 


    Steps to set the new password:



    use mysql;
    update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
    flush privileges;
    quit





    share|improve this answer
























    • Gave it a try but $ ps aux | grep mysql kill pid gives grep: kill: No such file or directory grep: pid: No such file or directory, then rest of steps same problem as question (... pid ended). When I tried just ps aux | grep mysql then kill (pid) where pid it the number in the pid column, it says No such process.

      – Luke Moll
      Dec 19 '14 at 16:50
















    1












    1








    1







    This issue might be caused due to several issue. You can find the exact error from "tail /var/log/mysql/error.log". I have added the default fix for these kind of issues. If the below is not working then update us the print from log where we can try to get some info and move further



    Kill all the MySQL process using the following command.



    ps aux | grep mysql kill pid


    Find the path of mysqld daemon using the "which mysqld_safe" command



    Start MySQL without grant tables from the mysqld_safe location



    /mysqld_safe_available_directory/mysqld_safe --skip-grant-tables &


    ex /bin/mysqld_safe



    mysql -u root 


    Steps to set the new password:



    use mysql;
    update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
    flush privileges;
    quit





    share|improve this answer













    This issue might be caused due to several issue. You can find the exact error from "tail /var/log/mysql/error.log". I have added the default fix for these kind of issues. If the below is not working then update us the print from log where we can try to get some info and move further



    Kill all the MySQL process using the following command.



    ps aux | grep mysql kill pid


    Find the path of mysqld daemon using the "which mysqld_safe" command



    Start MySQL without grant tables from the mysqld_safe location



    /mysqld_safe_available_directory/mysqld_safe --skip-grant-tables &


    ex /bin/mysqld_safe



    mysql -u root 


    Steps to set the new password:



    use mysql;
    update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
    flush privileges;
    quit






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 19 '14 at 16:38









    vembutechvembutech

    5,41411317




    5,41411317













    • Gave it a try but $ ps aux | grep mysql kill pid gives grep: kill: No such file or directory grep: pid: No such file or directory, then rest of steps same problem as question (... pid ended). When I tried just ps aux | grep mysql then kill (pid) where pid it the number in the pid column, it says No such process.

      – Luke Moll
      Dec 19 '14 at 16:50





















    • Gave it a try but $ ps aux | grep mysql kill pid gives grep: kill: No such file or directory grep: pid: No such file or directory, then rest of steps same problem as question (... pid ended). When I tried just ps aux | grep mysql then kill (pid) where pid it the number in the pid column, it says No such process.

      – Luke Moll
      Dec 19 '14 at 16:50



















    Gave it a try but $ ps aux | grep mysql kill pid gives grep: kill: No such file or directory grep: pid: No such file or directory, then rest of steps same problem as question (... pid ended). When I tried just ps aux | grep mysql then kill (pid) where pid it the number in the pid column, it says No such process.

    – Luke Moll
    Dec 19 '14 at 16:50







    Gave it a try but $ ps aux | grep mysql kill pid gives grep: kill: No such file or directory grep: pid: No such file or directory, then rest of steps same problem as question (... pid ended). When I tried just ps aux | grep mysql then kill (pid) where pid it the number in the pid column, it says No such process.

    – Luke Moll
    Dec 19 '14 at 16:50













    0














    I faced same problem
    Aborting come from permission on /var/lib/mysql
    the folder belong to user mysql, then root has no fully access



    solved it by:



    $ sudo su - mysql

    $ mysqld_safe --skip-grant-tables &





    share|improve this answer




























      0














      I faced same problem
      Aborting come from permission on /var/lib/mysql
      the folder belong to user mysql, then root has no fully access



      solved it by:



      $ sudo su - mysql

      $ mysqld_safe --skip-grant-tables &





      share|improve this answer


























        0












        0








        0







        I faced same problem
        Aborting come from permission on /var/lib/mysql
        the folder belong to user mysql, then root has no fully access



        solved it by:



        $ sudo su - mysql

        $ mysqld_safe --skip-grant-tables &





        share|improve this answer













        I faced same problem
        Aborting come from permission on /var/lib/mysql
        the folder belong to user mysql, then root has no fully access



        solved it by:



        $ sudo su - mysql

        $ mysqld_safe --skip-grant-tables &






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 29 at 2:55









        raksa engraksa eng

        1313




        1313






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • 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%2fsuperuser.com%2fquestions%2f854637%2fcant-start-mysql-to-reset-root-password%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

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

             ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕