Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Resetting mysql password woes
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Resetting mysql password woes

This is what I usually used to do for resetting a forgotten mysql root password: pastebin.com/ZeXKezXU

Unfortunately, as you can see above, the reset password is not being authenticated. Any idea why? This is debian jessie on an ovh ks1.

Comments

  • dailydaily Member
    edited June 2016

    this works for me:

    sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking & mysql -u root FLUSH PRIVILEGES; SET PASSWORD FOR root@'localhost' = PASSWORD('newpassword');

    taken from https://help.ubuntu.com/community/MysqlPasswordReset

  • DroidzoneDroidzone Member
    edited June 2016

    @daily said:
    this works for me:

    sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking & mysql -u root

    That does temporarily login as root. However I'm unable to change the root password after that.

  • dailydaily Member

    Droidzone said: Bash

    @Droidzone said:

    @daily said:
    this works for me:

    sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking & mysql -u root

    That does temporarily login as root. However I'm unable to change the root password after that.

    Accidentally posted early, updated.

  • DamianDamian Member

    Droidzone said: Server version: 5.5.49-0+deb8u1 (Debian)

    You might be able to reset the password with dpkg-reconfigure mysql-server or mysql-server-5.5, depending on the package name.

  • raindog308raindog308 Administrator, Veteran

    Did you try:

    SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new-password-here');
    FLUSH PRIVILEGES;
    

    ?

    Thanked by 1netomx
  • @raindog308 said:
    Did you try:

    > SET PASSWORD FOR 'root'@'localhost' = PASSWORD('new-password-here');
    > FLUSH PRIVILEGES;
    > 

    ?

    I did. Same effect (password is not being updated).

    Damian said: You might be able to reset the password with dpkg-reconfigure mysql-server or mysql-server-5.5, depending on the package name.

    It accepted the password, but again on logging in, I again got ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

  • CloudxtnyHostCloudxtnyHost Member, Host Rep

    by any chance could this be related to appmon on Debian/Ubuntu or selinux ? I know I have had a similar problem updating mysql file with appmon running

    Thanked by 1zafouhar
  • httpzoom said: by any chance could this be related to appmon on Debian/Ubuntu or selinux ?

    I dont use appmon.

  • tommytommy Member

    Do you have localhost mapped to 127.0.0x on host file?
    Try ping localhost

    Maybe try using 127.0.0.1 instead localhost?

    After login, as you said above, execute mysql status look at current user blablabla@xxxx

  • DroidzoneDroidzone Member
    edited June 2016

    tommy said: Do you have localhost mapped to 127.0.0x on host file? Try ping localhost

    I do.

    After login, as you said above, execute mysql status look at current user blablabla@xxxx

    Did you mean the SHOW STATUS command?

  • tommytommy Member

    Opps yes, I'm on mobile so not really easy to typing

    @localhost or @127.0.0.1 there?
    I've that problem some times ago, because localhost not mapped to 127.0.0.1

  • SHOW STATUS lists a lot of rows. I dont think this is what you were expecting:

    mysql> show status;
    +------------------------------------------+-------------+
    | Variable_name                            | Value       |
    +------------------------------------------+-------------+
    | Aborted_clients                          | 0           |
    | Aborted_connects                         | 0           |
    | Binlog_cache_disk_use                    | 0           |
    | Binlog_cache_use                         | 0           |
    | Binlog_stmt_cache_disk_use               | 0           |
    | Binlog_stmt_cache_use                    | 0           |
    | Bytes_received                           | 117         |
    | Bytes_sent                               | 177         |
    | Com_admin_commands                       | 0           |
    | Com_assign_to_keycache                   | 0           |
    | Com_alter_db                             | 0           |
    | Com_alter_db_upgrade                     | 0           |
    | Com_alter_event                          | 0           |
    | Com_alter_function                       | 0           |
    | Com_alter_procedure                      | 0           |
    
  • tommytommy Member

    opps sorry, after login to mysql enter status

    mysql> status;
    --------------
    mysql  Ver 14.14 Distrib 5.5.49, for debian-linux-gnu (x86_64) using readline 6.3
    
    Connection id:      501399
    Current database:   
    Current user:       [email protected]
    SSL:            Not in use
    Current pager:      stdout
    Using outfile:      ''
    Using delimiter:    ;
    Server version:     5.5.49-0+deb8u1 (Debian)
    Protocol version:   10
    Connection:     Localhost via UNIX socket
    Server characterset:    latin1
    Db     characterset:    latin1
    Client characterset:    utf8
    Conn.  characterset:    utf8
    UNIX socket:        /var/run/mysqld/mysqld.sock
    Uptime:         8 days 3 hours 40 min 44 sec
    
  • DroidzoneDroidzone Member
    edited June 2016
    mysql  Ver 14.14 Distrib 5.5.49, for debian-linux-gnu (x86_64) using readline 6.3
    Connection id:      47
    Current database:   
    Current user:       root@
    SSL:            Not in use
    Current pager:      stdout
    Using outfile:      ''
    Using delimiter:    ;
    Server version:     5.5.49-0+deb8u1 (Debian)
    Protocol version:   10
    Connection:     Localhost via UNIX socket
    Server characterset:    latin1
    Db     characterset:    latin1
    Client characterset:    utf8
    Conn.  characterset:    utf8
    UNIX socket:        /var/run/mysqld/mysqld.sock
    Uptime:         54 min 16 sec
    Threads: 1  Questions: 1213  Slow queries: 0  Opens: 52  Flush tables: 1  Open tables: 47  Queries per second avg: 0.372
    

    Hmm.. so my issue is the same as yours?

  • tommytommy Member
    edited June 2016

    cloudflare f.

    check this http://pastebin.com/raw/m7TV8DEQ

  • xmobxmob Member

    Does your debian-sys-maint account still work?

    mysql --defaults-file=/etc/mysql/debian.cnf
    
    set password for 'root'@'localhost' = password("whatever");
    
  • DroidzoneDroidzone Member
    edited June 2016

    @xmob said:
    Does your debian-sys-maint account still work?

    > mysql --defaults-file=/etc/mysql/debian.cnf
    > 
    > set password for 'root'@'localhost' = password("whatever");
    > 

    The account still works, but changing root password does not work. At the moment, I make do by creating a seperate user, and granting all privileges to that one.

  • this may be a stupid question... are you logging in to the correct database? are you possibly logging into a backup or old database?

  • @seaeagle said:
    this may be a stupid question... are you logging in to the correct database? are you possibly logging into a backup or old database?

    It's the correct database

  • localhostlocalhost Member
    edited July 2017

    nvm i have a bad sense of humor.

  • RazzaRazza Member

    @localhost said:
    nvm i have a bad sense of humor.

    Having fun doing some necroposting i see.

Sign In or Register to comment.