18.04 - Not able to connect to mysqlMySQL install error?MySQL Access denied for user 'root'@'localhost'Mariadb not working just after install on Ubuntu 16.04Cannot Connect to Database ServerERROR 1698 (28000): Access denied for user 'root'@'localhost'ubuntu16.04 mysql The program 'mysql' can be found in the following packages:

Regions in 3D acting strange with cuboids

How much would we learn from observing an FTL starship fly by?

What is the rationale for single engine military aircraft?

Sudo directive in /etc/sudoers.d doesn't work (but it's fine if it's in /etc/sudoers)

How do I find more throat sprays?

Packing disks of infinitesimal diameter on a sphere: the asymptotics of the Tammes problem

In academic writing why do some recommend to avoid "announcing" the topic?

Why is Gaia operating around Earth orbit? Why not send it to Neptune's orbit?

What is the difference between "more" and "less" commands?

Why the highlighted outline in animated cartoons?

How many flight hours do the first retiring A380s have?

Do I need to use capacitors when using an L7805CV voltage regulator?

Baby's head always turned to one side: should I do anything?

Average number of random permutations of a sequence, before seeing a sorted sequence

Pattern matching expressions that have been simplified

How do you help a new player evaluate complex multiclassing options without driving them and yourself crazy?

Why give an android emotions?

Chess Tournaments without Studying Theory?

How can I justify this without determining the determinant?

Did any significant programs or environments take advantage of the Rexx which came with PCDOS 7 (aka PCDOS 2000)?

Router wont hold config

Runge-Kutta in the presence of an attractor

Can you combine DDR3 and DDR4?

United States Towns/States Traversing by Name Puzzle



18.04 - Not able to connect to mysql


MySQL install error?MySQL Access denied for user 'root'@'localhost'Mariadb not working just after install on Ubuntu 16.04Cannot Connect to Database ServerERROR 1698 (28000): Access denied for user 'root'@'localhost'ubuntu16.04 mysql The program 'mysql' can be found in the following packages:






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









2


















So I've been trying to setup my new work development system, I have gotten everything installed and setup properly except MySQL. I've been trying everything I can even think of to gain access to mysql root but nothing is working.



Specs



  • Dell Inspiron 5575

  • Ubuntu 18.04 LTS upgrades to date

  • Mysql 5.7.27

  • Mariadb 10.1.14

Here's what I've tried.



Installing a fresh MySQL Installation



  • ~$ sudo apt install mysql-server mysql-client

  • This does not log any a temporary password and /var/log/mysqld.log is not generated.

  • ~$ mysql -u root

  • Access denied for user 'root'@'localhost'

  • When removing to get fresh installation

  • ~$ sudo apt purge mysql-server mysql-common mysql-client

  • ~$ sudo apt autoremove mysql-server mysql-common mysql-client

Mysql Secure Installation



  • ~$ sudo mysql_secure_installation

  • I go through secure installation normally, reports that it tried a blank password, get asked all questions and set my root password

  • ~$ mysql -u root -p

  • Type in my password

  • Access denied for user 'root'@'localhost'

  • Seems like it didn't properly set a password, or falsely showed that it gained access

Mysqld Safe



  • ~$ sudo service mysql stop

  • Service stops

  • ~$ sudo mysqld_safe --skip-grant-tables --skip-networking &

  • I've gotten many different responses on this, however this is the latest one

  • mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.

  • ~$ sudo mkdir -p /var/run/mysqld

  • ~$ sudo mysqld_safe --skip-grant-tables --skip-networking &

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

  • ~$ sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &

  • Instakill

Mariadb



  • ~$ sudo apt install mariadb-server mariadb-client

  • `Job for mariadb.service failed because a timeout was exceeded.'

  • ~$ sudo systemctl status mariadb.service

  • mariadb.service: Start operation timed out. Terminating.

  • Okay, so mariadb doesn't like me either...

What else can I try or is there some known bug that I'm being effected by right now? I feel like I'm driving myself mad trying to solve this.



Solution
My system requires MySQL to be run by a super user.
$ sudo mysql -u root -p allows me in.



What caused this
- It gave me a MySQL access denied error rather than a permissions error so I couldn't tell that was the issue, however I do feel a little dumb for not trying to super user that command, simple mistakes do happen. Thank you for the marked answer for helping me out and pointing that out.










share|improve this question

































    2


















    So I've been trying to setup my new work development system, I have gotten everything installed and setup properly except MySQL. I've been trying everything I can even think of to gain access to mysql root but nothing is working.



    Specs



    • Dell Inspiron 5575

    • Ubuntu 18.04 LTS upgrades to date

    • Mysql 5.7.27

    • Mariadb 10.1.14

    Here's what I've tried.



    Installing a fresh MySQL Installation



    • ~$ sudo apt install mysql-server mysql-client

    • This does not log any a temporary password and /var/log/mysqld.log is not generated.

    • ~$ mysql -u root

    • Access denied for user 'root'@'localhost'

    • When removing to get fresh installation

    • ~$ sudo apt purge mysql-server mysql-common mysql-client

    • ~$ sudo apt autoremove mysql-server mysql-common mysql-client

    Mysql Secure Installation



    • ~$ sudo mysql_secure_installation

    • I go through secure installation normally, reports that it tried a blank password, get asked all questions and set my root password

    • ~$ mysql -u root -p

    • Type in my password

    • Access denied for user 'root'@'localhost'

    • Seems like it didn't properly set a password, or falsely showed that it gained access

    Mysqld Safe



    • ~$ sudo service mysql stop

    • Service stops

    • ~$ sudo mysqld_safe --skip-grant-tables --skip-networking &

    • I've gotten many different responses on this, however this is the latest one

    • mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.

    • ~$ sudo mkdir -p /var/run/mysqld

    • ~$ sudo mysqld_safe --skip-grant-tables --skip-networking &

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

    • ~$ sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &

    • Instakill

    Mariadb



    • ~$ sudo apt install mariadb-server mariadb-client

    • `Job for mariadb.service failed because a timeout was exceeded.'

    • ~$ sudo systemctl status mariadb.service

    • mariadb.service: Start operation timed out. Terminating.

    • Okay, so mariadb doesn't like me either...

    What else can I try or is there some known bug that I'm being effected by right now? I feel like I'm driving myself mad trying to solve this.



    Solution
    My system requires MySQL to be run by a super user.
    $ sudo mysql -u root -p allows me in.



    What caused this
    - It gave me a MySQL access denied error rather than a permissions error so I couldn't tell that was the issue, however I do feel a little dumb for not trying to super user that command, simple mistakes do happen. Thank you for the marked answer for helping me out and pointing that out.










    share|improve this question





























      2













      2









      2








      So I've been trying to setup my new work development system, I have gotten everything installed and setup properly except MySQL. I've been trying everything I can even think of to gain access to mysql root but nothing is working.



      Specs



      • Dell Inspiron 5575

      • Ubuntu 18.04 LTS upgrades to date

      • Mysql 5.7.27

      • Mariadb 10.1.14

      Here's what I've tried.



      Installing a fresh MySQL Installation



      • ~$ sudo apt install mysql-server mysql-client

      • This does not log any a temporary password and /var/log/mysqld.log is not generated.

      • ~$ mysql -u root

      • Access denied for user 'root'@'localhost'

      • When removing to get fresh installation

      • ~$ sudo apt purge mysql-server mysql-common mysql-client

      • ~$ sudo apt autoremove mysql-server mysql-common mysql-client

      Mysql Secure Installation



      • ~$ sudo mysql_secure_installation

      • I go through secure installation normally, reports that it tried a blank password, get asked all questions and set my root password

      • ~$ mysql -u root -p

      • Type in my password

      • Access denied for user 'root'@'localhost'

      • Seems like it didn't properly set a password, or falsely showed that it gained access

      Mysqld Safe



      • ~$ sudo service mysql stop

      • Service stops

      • ~$ sudo mysqld_safe --skip-grant-tables --skip-networking &

      • I've gotten many different responses on this, however this is the latest one

      • mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.

      • ~$ sudo mkdir -p /var/run/mysqld

      • ~$ sudo mysqld_safe --skip-grant-tables --skip-networking &

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

      • ~$ sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &

      • Instakill

      Mariadb



      • ~$ sudo apt install mariadb-server mariadb-client

      • `Job for mariadb.service failed because a timeout was exceeded.'

      • ~$ sudo systemctl status mariadb.service

      • mariadb.service: Start operation timed out. Terminating.

      • Okay, so mariadb doesn't like me either...

      What else can I try or is there some known bug that I'm being effected by right now? I feel like I'm driving myself mad trying to solve this.



      Solution
      My system requires MySQL to be run by a super user.
      $ sudo mysql -u root -p allows me in.



      What caused this
      - It gave me a MySQL access denied error rather than a permissions error so I couldn't tell that was the issue, however I do feel a little dumb for not trying to super user that command, simple mistakes do happen. Thank you for the marked answer for helping me out and pointing that out.










      share|improve this question
















      So I've been trying to setup my new work development system, I have gotten everything installed and setup properly except MySQL. I've been trying everything I can even think of to gain access to mysql root but nothing is working.



      Specs



      • Dell Inspiron 5575

      • Ubuntu 18.04 LTS upgrades to date

      • Mysql 5.7.27

      • Mariadb 10.1.14

      Here's what I've tried.



      Installing a fresh MySQL Installation



      • ~$ sudo apt install mysql-server mysql-client

      • This does not log any a temporary password and /var/log/mysqld.log is not generated.

      • ~$ mysql -u root

      • Access denied for user 'root'@'localhost'

      • When removing to get fresh installation

      • ~$ sudo apt purge mysql-server mysql-common mysql-client

      • ~$ sudo apt autoremove mysql-server mysql-common mysql-client

      Mysql Secure Installation



      • ~$ sudo mysql_secure_installation

      • I go through secure installation normally, reports that it tried a blank password, get asked all questions and set my root password

      • ~$ mysql -u root -p

      • Type in my password

      • Access denied for user 'root'@'localhost'

      • Seems like it didn't properly set a password, or falsely showed that it gained access

      Mysqld Safe



      • ~$ sudo service mysql stop

      • Service stops

      • ~$ sudo mysqld_safe --skip-grant-tables --skip-networking &

      • I've gotten many different responses on this, however this is the latest one

      • mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.

      • ~$ sudo mkdir -p /var/run/mysqld

      • ~$ sudo mysqld_safe --skip-grant-tables --skip-networking &

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

      • ~$ sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &

      • Instakill

      Mariadb



      • ~$ sudo apt install mariadb-server mariadb-client

      • `Job for mariadb.service failed because a timeout was exceeded.'

      • ~$ sudo systemctl status mariadb.service

      • mariadb.service: Start operation timed out. Terminating.

      • Okay, so mariadb doesn't like me either...

      What else can I try or is there some known bug that I'm being effected by right now? I feel like I'm driving myself mad trying to solve this.



      Solution
      My system requires MySQL to be run by a super user.
      $ sudo mysql -u root -p allows me in.



      What caused this
      - It gave me a MySQL access denied error rather than a permissions error so I couldn't tell that was the issue, however I do feel a little dumb for not trying to super user that command, simple mistakes do happen. Thank you for the marked answer for helping me out and pointing that out.







      server apache2 mysql database mariadb






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 20 at 2:46







      pbcub1

















      asked Sep 19 at 21:10









      pbcub1pbcub1

      234 bronze badges




      234 bronze badges























          1 Answer
          1






          active

          oldest

          votes


















          0



















          You might want to try throwing a sudo in front of mysql -u root -p. I was experiencing a similar issue and ended up doing this.



          If you continue running into issues with the root user I would recommend making a new user account and give it the same privileges. I did this and it cleared up a lot of my headaches. This was a helpful resource for me: https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql






          share|improve this answer


























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            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/4.0/"u003ecc by-sa 4.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%2faskubuntu.com%2fquestions%2f1175355%2f18-04-not-able-to-connect-to-mysql%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



















            You might want to try throwing a sudo in front of mysql -u root -p. I was experiencing a similar issue and ended up doing this.



            If you continue running into issues with the root user I would recommend making a new user account and give it the same privileges. I did this and it cleared up a lot of my headaches. This was a helpful resource for me: https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql






            share|improve this answer





























              0



















              You might want to try throwing a sudo in front of mysql -u root -p. I was experiencing a similar issue and ended up doing this.



              If you continue running into issues with the root user I would recommend making a new user account and give it the same privileges. I did this and it cleared up a lot of my headaches. This was a helpful resource for me: https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql






              share|improve this answer



























                0















                0











                0









                You might want to try throwing a sudo in front of mysql -u root -p. I was experiencing a similar issue and ended up doing this.



                If you continue running into issues with the root user I would recommend making a new user account and give it the same privileges. I did this and it cleared up a lot of my headaches. This was a helpful resource for me: https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql






                share|improve this answer














                You might want to try throwing a sudo in front of mysql -u root -p. I was experiencing a similar issue and ended up doing this.



                If you continue running into issues with the root user I would recommend making a new user account and give it the same privileges. I did this and it cleared up a lot of my headaches. This was a helpful resource for me: https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql







                share|improve this answer













                share|improve this answer




                share|improve this answer










                answered Sep 20 at 2:18









                swhitmoreswhitmore

                162 bronze badges




                162 bronze badges































                    draft saved

                    draft discarded















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • 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%2faskubuntu.com%2fquestions%2f1175355%2f18-04-not-able-to-connect-to-mysql%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

                    Tamil (spriik) Luke uk diar | Nawigatjuun

                    Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

                    Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?