Results 1 to 7 of 7

Thread: Chanring MariaDB default root paswword on Leap 15

  1. #1

    Default Chanring MariaDB default root paswword on Leap 15

    Hi everyone.

    So I have just installed MariaDB on Leap 15 using zypper in mariadb.

    When I run mysql_secure_installation, it gives me the error below.
    Basically, I cannot change the password.

    I looked at many different places around the web, but no luck. The password either fails to change, or just does not change.

    Any ideas? Thank you!

    Code:
    mysql_secure_installation 
    
    NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
          SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
    
    In order to log into MariaDB to secure it, we'll need the current
    password for the root user.  If you've just installed MariaDB, and
    you haven't set the root password yet, the password will be blank,
    so you should just press enter here.
    
    Enter current password for root (enter for none): 
    OK, successfully used password, moving on...
    
    Setting the root password ensures that nobody can log into the MariaDB
    root user without the proper authorisation.
    
    Set root password? [Y/n] Y
    New password: 
    Re-enter new password: 
    ERROR 1142 (42000) at line 1: UPDATE command denied to user ''@'localhost' for table 'user'
    Password update failed!
    Cleaning up...

  2. #2

    Default Re: Chanring MariaDB default root paswword on Leap 15

    It looks like it is not using a username when connecting, so you are
    nobody, meaning no privileges. Try adding --user root to the command line:

    https://dev.mysql.com/doc/refman/5.7...tallation.html

    --
    Good luck.

    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below.

    If you want to send me a private message, please let me know in the
    forum as I do not use the web interface often.

  3. #3
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    19,654
    Blog Entries
    14

    Default Re: Chanring MariaDB default root paswword on Leap 15

    The default password after install is empty. But, did the mysqld.service run?
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,934
    Blog Entries
    2

    Default Re: Chanring MariaDB default root paswword on Leap 15

    Here you go...
    To explain how to create a simple script that memorializes your settings or can set up multiple MySQL/MariaDB the same way, setting up security has to be explained
    Note that the MySQL/Mariadb root account is different than the system root account, and your error is asking for the latter (system root credentials).

    https://en.opensuse.org/User:Tsu2/MySQL_and_Mariadb

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  5. #5

    Default Re: Chanring MariaDB default root paswword on Leap 15

    On 02/25/2019 11:46 AM, tsu2 wrote:
    >
    > Here you go...
    > To explain how to create a simple script that memorializes your settings
    > or can set up multiple MySQL/MariaDB the same way, setting up security
    > has to be explained
    > Note that the MySQL/Mariadb root account is different than the system
    > root account, and your error is asking for the latter (system root
    > credentials).


    Don't you mean the former, MySQL/MariaDB 'root' account credentials? The
    script's purpose is to set the database crednetials, and it was
    authenticating (per my understanding of the error message) without a
    username. Granted, I have not tested this script ever, as I set
    credentials directly when setting up a new box.

    --
    Good luck.

    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below.

    If you want to send me a private message, please let me know in the
    forum as I do not use the web interface often.

  6. #6
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,934
    Blog Entries
    2

    Default Re: Chanring MariaDB default root paswword on Leap 15

    Quote Originally Posted by ab View Post
    On 02/25/2019 11:46 AM, tsu2 wrote:
    >
    > Here you go...
    > To explain how to create a simple script that memorializes your settings
    > or can set up multiple MySQL/MariaDB the same way, setting up security
    > has to be explained
    > Note that the MySQL/Mariadb root account is different than the system
    > root account, and your error is asking for the latter (system root
    > credentials).


    Don't you mean the former, MySQL/MariaDB 'root' account credentials? The
    script's purpose is to set the database crednetials, and it was
    authenticating (per my understanding of the error message) without a
    username. Granted, I have not tested this script ever, as I set
    credentials directly when setting up a new box.

    --
    Good luck.

    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below.

    If you want to send me a private message, please let me know in the
    forum as I do not use the web interface often.
    Yes, re-reading the error I read it incorrectly.
    Trying to remember when I ran into a similar error long ago, I seem to remember it had to do with the "@localhost" reference in the error. You have to connect to the database using the exactly correct server identification, not an alias like an IP address or hostname.

    But, with an Internet search I also see many other possible causes,
    You'll probably have two main options...
    Collect all the possible causes and try the fix for each one of them
    You can try to reset the MariaDB root password, but if the grant tables don't already allow access to the MariaDB root account, that won't help you.
    But, with the MariaDB root account you might be able to grant yourself permissions to access... I haven't done this on a MariaDB/MySQL database, only on a different RDMS so I imagine this should be possible but don't know off the top of my head how to do it (but should not be easy to find).

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  7. #7

    Default Re: Chanring MariaDB default root paswword on Leap 15

    On 02/26/2019 03:56 PM, tsu2 wrote:
    >
    > Trying to remember when I ran into a similar error long ago, I seem to
    > remember it had to do with the "@localhost" reference in the error. You
    > have to connect to the database using the exactly correct server
    > identification, not an alias like an IP address or hostname.


    An interesting quirk of MariaDB/MySQL is that credentials are based on
    three (3) things rather than two (2), the username, the password, and the
    location from which the user originates. With that said, usually
    'root@localhost' is given all privileges. As a result, I think if the
    username can get in there (via that flag I cited) I think it might work.

    > But, with the MariaDB root account you might be able to grant yourself
    > permissions to access... I haven't done this on a MariaDB/MySQL
    > database, only on a different RDMS so I imagine this should be possible
    > but don't know off the top of my head how to do it (but should not be
    > easy to find).


    Yes, you can definitely start MariaDB/MySQL in a mode that ignores
    privileges, effectively making you a superuser, and then you can grant
    rights to root@whatever and restart normally. I believe the option is
    --skip-grant-tables so Google for that for more if needed.

    --
    Good luck.

    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below.

    If you want to send me a private message, please let me know in the
    forum as I do not use the web interface often.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •