What is the default MySQL 5.7.18 root password?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















I've struggled with this problem for years and I always end up having to mess around for a long time with different reset methods or a combination of other crap.



On a new MySQL server install, what's the default root password? It's not admin, root, blank etc... I have no /var/log/mysql.log file to look for a temporary password:



brandon@brandon:~$ ls -la /var/log/mysql/ total 112 drwxr-x---  2 mysql adm     4096 Jun 24 21:14 . drwxrwxr-x 16 root  syslog  4096 Jun 24 21:14 ..
-rw-r----- 1 mysql adm 66416 Jun 24 22:15 error.log
-rw-r----- 1 mysql adm 1768 Jun 24 21:10 error.log.1.gz
-rw-r----- 1 mysql adm 1755 Jun 20 17:05 error.log.2.gz
-rw-r----- 1 mysql adm 2231 Jun 15 20:53 error.log.3.gz
-rw-r----- 1 mysql adm 3204 Jun 6 21:42 error.log.4.gz
-rw-r----- 1 mysql adm 2347 Jun 5 09:24 error.log.5.gz
-rw-r----- 1 mysql adm 8289 Jun 2 18:33 error.log.6.gz


I looked at the mysql config file (which is now at /etc/mysql/mysql.conf.d/mysqld.cnf and not /etc/mysql/my.cnf??) and found that the logs to /var/log/mysql/mysqld.log were disabled by default. Enabled them hoping for a miracle to no avail. No temporary password in there.



Starting MySQL with skip-grant-tables (per the MySQL docs on the subject) to force-reset the password isn't working now either.



Running sudo mysql_secure_installation and setting the password didn't reset the password either.



How do I get in?










share|improve this question

























  • Depends if it asks you when you install it in terminal, else it's null

    – treyBake
    Jun 25 '17 at 3:50













  • It didn't ask and null, <blank> etc... Are not working

    – Brandon
    Jun 25 '17 at 4:14











  • how are you trying to access mydql? If no password is needed, you don't need to specify the -p parameter

    – treyBake
    Jun 25 '17 at 10:43











  • Tried with mysql -uroot -p and mysql -uroot. Access denied.

    – Brandon
    Jun 25 '17 at 12:08











  • The password will be written (during installation) to the error-log, so have you checked the error.log-file or any .log or .err-file in your data directory? It should contain the text temporary password somewhere.

    – Solarflare
    Jun 25 '17 at 16:22




















1















I've struggled with this problem for years and I always end up having to mess around for a long time with different reset methods or a combination of other crap.



On a new MySQL server install, what's the default root password? It's not admin, root, blank etc... I have no /var/log/mysql.log file to look for a temporary password:



brandon@brandon:~$ ls -la /var/log/mysql/ total 112 drwxr-x---  2 mysql adm     4096 Jun 24 21:14 . drwxrwxr-x 16 root  syslog  4096 Jun 24 21:14 ..
-rw-r----- 1 mysql adm 66416 Jun 24 22:15 error.log
-rw-r----- 1 mysql adm 1768 Jun 24 21:10 error.log.1.gz
-rw-r----- 1 mysql adm 1755 Jun 20 17:05 error.log.2.gz
-rw-r----- 1 mysql adm 2231 Jun 15 20:53 error.log.3.gz
-rw-r----- 1 mysql adm 3204 Jun 6 21:42 error.log.4.gz
-rw-r----- 1 mysql adm 2347 Jun 5 09:24 error.log.5.gz
-rw-r----- 1 mysql adm 8289 Jun 2 18:33 error.log.6.gz


I looked at the mysql config file (which is now at /etc/mysql/mysql.conf.d/mysqld.cnf and not /etc/mysql/my.cnf??) and found that the logs to /var/log/mysql/mysqld.log were disabled by default. Enabled them hoping for a miracle to no avail. No temporary password in there.



Starting MySQL with skip-grant-tables (per the MySQL docs on the subject) to force-reset the password isn't working now either.



Running sudo mysql_secure_installation and setting the password didn't reset the password either.



How do I get in?










share|improve this question

























  • Depends if it asks you when you install it in terminal, else it's null

    – treyBake
    Jun 25 '17 at 3:50













  • It didn't ask and null, <blank> etc... Are not working

    – Brandon
    Jun 25 '17 at 4:14











  • how are you trying to access mydql? If no password is needed, you don't need to specify the -p parameter

    – treyBake
    Jun 25 '17 at 10:43











  • Tried with mysql -uroot -p and mysql -uroot. Access denied.

    – Brandon
    Jun 25 '17 at 12:08











  • The password will be written (during installation) to the error-log, so have you checked the error.log-file or any .log or .err-file in your data directory? It should contain the text temporary password somewhere.

    – Solarflare
    Jun 25 '17 at 16:22
















1












1








1








I've struggled with this problem for years and I always end up having to mess around for a long time with different reset methods or a combination of other crap.



On a new MySQL server install, what's the default root password? It's not admin, root, blank etc... I have no /var/log/mysql.log file to look for a temporary password:



brandon@brandon:~$ ls -la /var/log/mysql/ total 112 drwxr-x---  2 mysql adm     4096 Jun 24 21:14 . drwxrwxr-x 16 root  syslog  4096 Jun 24 21:14 ..
-rw-r----- 1 mysql adm 66416 Jun 24 22:15 error.log
-rw-r----- 1 mysql adm 1768 Jun 24 21:10 error.log.1.gz
-rw-r----- 1 mysql adm 1755 Jun 20 17:05 error.log.2.gz
-rw-r----- 1 mysql adm 2231 Jun 15 20:53 error.log.3.gz
-rw-r----- 1 mysql adm 3204 Jun 6 21:42 error.log.4.gz
-rw-r----- 1 mysql adm 2347 Jun 5 09:24 error.log.5.gz
-rw-r----- 1 mysql adm 8289 Jun 2 18:33 error.log.6.gz


I looked at the mysql config file (which is now at /etc/mysql/mysql.conf.d/mysqld.cnf and not /etc/mysql/my.cnf??) and found that the logs to /var/log/mysql/mysqld.log were disabled by default. Enabled them hoping for a miracle to no avail. No temporary password in there.



Starting MySQL with skip-grant-tables (per the MySQL docs on the subject) to force-reset the password isn't working now either.



Running sudo mysql_secure_installation and setting the password didn't reset the password either.



How do I get in?










share|improve this question
















I've struggled with this problem for years and I always end up having to mess around for a long time with different reset methods or a combination of other crap.



On a new MySQL server install, what's the default root password? It's not admin, root, blank etc... I have no /var/log/mysql.log file to look for a temporary password:



brandon@brandon:~$ ls -la /var/log/mysql/ total 112 drwxr-x---  2 mysql adm     4096 Jun 24 21:14 . drwxrwxr-x 16 root  syslog  4096 Jun 24 21:14 ..
-rw-r----- 1 mysql adm 66416 Jun 24 22:15 error.log
-rw-r----- 1 mysql adm 1768 Jun 24 21:10 error.log.1.gz
-rw-r----- 1 mysql adm 1755 Jun 20 17:05 error.log.2.gz
-rw-r----- 1 mysql adm 2231 Jun 15 20:53 error.log.3.gz
-rw-r----- 1 mysql adm 3204 Jun 6 21:42 error.log.4.gz
-rw-r----- 1 mysql adm 2347 Jun 5 09:24 error.log.5.gz
-rw-r----- 1 mysql adm 8289 Jun 2 18:33 error.log.6.gz


I looked at the mysql config file (which is now at /etc/mysql/mysql.conf.d/mysqld.cnf and not /etc/mysql/my.cnf??) and found that the logs to /var/log/mysql/mysqld.log were disabled by default. Enabled them hoping for a miracle to no avail. No temporary password in there.



Starting MySQL with skip-grant-tables (per the MySQL docs on the subject) to force-reset the password isn't working now either.



Running sudo mysql_secure_installation and setting the password didn't reset the password either.



How do I get in?







mysql






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 25 '17 at 12:55







Brandon

















asked Jun 25 '17 at 2:55









BrandonBrandon

3,17733051




3,17733051













  • Depends if it asks you when you install it in terminal, else it's null

    – treyBake
    Jun 25 '17 at 3:50













  • It didn't ask and null, <blank> etc... Are not working

    – Brandon
    Jun 25 '17 at 4:14











  • how are you trying to access mydql? If no password is needed, you don't need to specify the -p parameter

    – treyBake
    Jun 25 '17 at 10:43











  • Tried with mysql -uroot -p and mysql -uroot. Access denied.

    – Brandon
    Jun 25 '17 at 12:08











  • The password will be written (during installation) to the error-log, so have you checked the error.log-file or any .log or .err-file in your data directory? It should contain the text temporary password somewhere.

    – Solarflare
    Jun 25 '17 at 16:22





















  • Depends if it asks you when you install it in terminal, else it's null

    – treyBake
    Jun 25 '17 at 3:50













  • It didn't ask and null, <blank> etc... Are not working

    – Brandon
    Jun 25 '17 at 4:14











  • how are you trying to access mydql? If no password is needed, you don't need to specify the -p parameter

    – treyBake
    Jun 25 '17 at 10:43











  • Tried with mysql -uroot -p and mysql -uroot. Access denied.

    – Brandon
    Jun 25 '17 at 12:08











  • The password will be written (during installation) to the error-log, so have you checked the error.log-file or any .log or .err-file in your data directory? It should contain the text temporary password somewhere.

    – Solarflare
    Jun 25 '17 at 16:22



















Depends if it asks you when you install it in terminal, else it's null

– treyBake
Jun 25 '17 at 3:50







Depends if it asks you when you install it in terminal, else it's null

– treyBake
Jun 25 '17 at 3:50















It didn't ask and null, <blank> etc... Are not working

– Brandon
Jun 25 '17 at 4:14





It didn't ask and null, <blank> etc... Are not working

– Brandon
Jun 25 '17 at 4:14













how are you trying to access mydql? If no password is needed, you don't need to specify the -p parameter

– treyBake
Jun 25 '17 at 10:43





how are you trying to access mydql? If no password is needed, you don't need to specify the -p parameter

– treyBake
Jun 25 '17 at 10:43













Tried with mysql -uroot -p and mysql -uroot. Access denied.

– Brandon
Jun 25 '17 at 12:08





Tried with mysql -uroot -p and mysql -uroot. Access denied.

– Brandon
Jun 25 '17 at 12:08













The password will be written (during installation) to the error-log, so have you checked the error.log-file or any .log or .err-file in your data directory? It should contain the text temporary password somewhere.

– Solarflare
Jun 25 '17 at 16:22







The password will be written (during installation) to the error-log, so have you checked the error.log-file or any .log or .err-file in your data directory? It should contain the text temporary password somewhere.

– Solarflare
Jun 25 '17 at 16:22














1 Answer
1






active

oldest

votes


















0














sudo mysql -uroot


will allow you to login, then you'll need to create a user for normal connection (not root).



create user 'user'@'localhost' identified by 'user1234';
grant all on your_database.* to 'user'@'localhost';
select host, user from mysql.user;


then try to access with your new user



mysql -u user -p





share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    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%2fstackoverflow.com%2fquestions%2f44742779%2fwhat-is-the-default-mysql-5-7-18-root-password%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














    sudo mysql -uroot


    will allow you to login, then you'll need to create a user for normal connection (not root).



    create user 'user'@'localhost' identified by 'user1234';
    grant all on your_database.* to 'user'@'localhost';
    select host, user from mysql.user;


    then try to access with your new user



    mysql -u user -p





    share|improve this answer




























      0














      sudo mysql -uroot


      will allow you to login, then you'll need to create a user for normal connection (not root).



      create user 'user'@'localhost' identified by 'user1234';
      grant all on your_database.* to 'user'@'localhost';
      select host, user from mysql.user;


      then try to access with your new user



      mysql -u user -p





      share|improve this answer


























        0












        0








        0







        sudo mysql -uroot


        will allow you to login, then you'll need to create a user for normal connection (not root).



        create user 'user'@'localhost' identified by 'user1234';
        grant all on your_database.* to 'user'@'localhost';
        select host, user from mysql.user;


        then try to access with your new user



        mysql -u user -p





        share|improve this answer













        sudo mysql -uroot


        will allow you to login, then you'll need to create a user for normal connection (not root).



        create user 'user'@'localhost' identified by 'user1234';
        grant all on your_database.* to 'user'@'localhost';
        select host, user from mysql.user;


        then try to access with your new user



        mysql -u user -p






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 16 '18 at 15:47









        Pablo PazosPablo Pazos

        1,5561125




        1,5561125
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • 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%2fstackoverflow.com%2fquestions%2f44742779%2fwhat-is-the-default-mysql-5-7-18-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

            Bressuire

            Vorschmack

            Quarantine