Announcement Announcement Module
Collapse

myhosting.com Forum Guidelines

Welcome to the myhosting.com Forums! The purpose of this forum is to allow you to discuss topics relating to hosting and topics of interest with other myhosting.com Customers. The primary focus should relate to issues not generally included in our Wiki or Control Panel, or information not provided by our Customer Support Team. Some examples include programming and coding support, web site design ideas and SEO practices.

The forum is not meant as a replacement to our Wiki or Customer Support. We highly recommend searching our Wiki before posting on the forum. Also, if you have a question for our Customer Support team, please contact them as you would normally.

We ask that if you have any complaints or questions relating specifically to your account, that you address them to our Customer Support department. Do not post personal account information such as passwords or other sensitive and private information the forum, as this type of information is best kept secret. Also, please be respectful of other users and refrain from defamatory comments or use of coarse language.

We will visit the forum from time to time, and contribute to various topics. We reserve the right to delete any posts which are deemed offensive or against the spirit of the forum. Any spamming or illegal activity will not be tolerated. We also reserve the right to block any user who violates these guidelines.

To get started, we welcome you to sign up at our User Management site. Any account created there will have access to these forums, our Wiki, our Ideas site and commenting permission on our Status Blog.
See more
See less
MySQL root user password Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • MySQL root user password

    Hi all

    I think that the installation of MySQL on a server usually includes setting the the MySQL root user password. My new Debian 6 VPS comes with MySQL pre-installed so does that mean that the MySQL root user password has already been set? If so where do I find it? I know there are SSH commands for setting and re-setting the MySQL root user password but of course these instructions are different according to whether I am creating a password for the first time or resetting an existing password.

    Thanks


    Attachment
    Attached Files

  • #2
    Hi Juc,

    This depends on whether or not you've got a control panel such as Plesk or cPanel, I believe both will set the MySQL root password accordingly (Plesk for sure). But on a vanilla VPS the password is not set at all by default.

    Comment


    • #3
      Originally posted by jeremya View Post
      Hi Juc,

      This depends on whether or not you've got a control panel such as Plesk or cPanel, I believe both will set the MySQL root password accordingly (Plesk for sure). But on a vanilla VPS the password is not set at all by default.
      Yes it is Parallels Plesk Panel 10.4.4 - but if the MySQL root password has already been set, where can I find it?

      Thanks

      Comment


      • #4
        Plesk apparently renames the root user for mysql to admin and sets the password but you can use Plesk commands to retrieve it

        # /usr/local/psa/bin/admin --show-password

        KB Parallels

        Comment


        • #5
          Originally posted by jeremya View Post
          Plesk apparently renames the root user for mysql to admin and sets the password but you can use Plesk commands to retrieve it

          # /usr/local/psa/bin/admin --show-password

          KB Parallels
          yes that works to get the password, thanks, but then if I use
          Code:
          mysql -uUSERNAME -pPASSWORD
          =
          Code:
          mysql -uadmin -pmypastedpassword
          I get

          Code:
          ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
          Does that make sense?

          Thanks

          Attachment
          Attached Files

          Comment


          • #6
            In Plesk by default mysql root is changed to admin. It's supposed to sync passwords with your admin password, but life is never that simple. Try:
            Code:
            mysql -uadmin -p `cat /etc/psa/.psa.shadow`
            linux - Using Plesk to setup MySQL - Super User

            Comment


            • #7
              Originally posted by suwunk View Post
              In Plesk by default mysql root is changed to admin. It's supposed to sync passwords with your admin password, but life is never that simple. Try:
              Code:
              mysql -uadmin -p `cat /etc/psa/.psa.shadow`
              linux - Using Plesk to setup MySQL - Super User
              I have tried two passwords - the one output by this...
              Code:
              # /usr/local/psa/bin/admin --show-password
              ...and the one that is my plesk login password but neither works and both give

              Code:
              ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: YES)
              Any suggestions please?

              Thanks
              Attachment
              Attached Files

              Comment


              • #8
                Please consult customer support before applying this following solution, it may cause Plesk failed to load.

                If this following command failed
                Code:
                mysql -uadmin -p `cat /etc/psa/.psa.shadow`
                You should try this following solution:
                1.Load MySQL with the 'skip-grant-tables' option by adding skip-grant-tables into [mysqld] section of the /etc/my.cnf file
                2.Restart MySQL with the command line below:
                Code:
                # /etc/init.d/mysqld restart
                3.Repair password with the command line below:
                Code:
                # /usr/bin/mysql -D mysql -e"update user set password=PASSWORD('`cat /etc/psa/.psa.shadow`') where User='admin';"
                4.Remove skip-grant-tables option from /etc/my.cnf
                5.Restart MySQL.

                If the solution above still not working, I recommend that you contact Customer Support.
                Last edited by suwunk; 2012-07-30, 02:43 PM.

                Comment


                • #9
                  Hi Juc,

                  Sometimes if there are special characters in passwords, pasting into the command line login command isn't the best approach. I've found more luck by typing "mysql -u username -p". When you do this, it will prompt you for the password. You can then past or type it in manually there and you shouldn't have character problems.

                  Comment


                  • #10
                    Also, unless you want to toy with fire and break Plesk' connection to the database, i would be very careful with the previous recommendations by Suwunk.

                    Comment

                    Working...
                    X