Results 1 to 5 of 5

Thread: phpMyAdmin - loss of root

  1. #1

    Default phpMyAdmin - loss of root

    Hello to the forum from a beginner.
    OS:13.2 on a dual boot with Win7
    Installed LAMP using http://en.opensuse.org/SDB:LAMP_setup
    Successful down to gaining access to phpMyAdmin at http://localhost/phpMyAdmin/
    Found the root admin page and the "Users" listing.
    Then did the stupid thing ......
    • created a new user with same privelages [by changing root to NewUserName]
    • do not change password
    • revoke all active ... from old one and delete ....

    Have a screenshot showing that the new user was created (at top section of phpMyAdmin window)
    Had a "Loading" bar for a long time.
    Cannot remember exactly how that ended or what I did next.
    But the result is now that I can enter phpMyAdmin as the NewUserName but have no privelages - and cannot se the users options and so can do nothing.
    In Dolphin - browsed to root>etc>my.cnf.d - but get error "Could not enter folder"
    Have also tried
    http://superuser.com/questions/46104...on-opensuse-11
    Using the 5 steps suggested but I am inexperienced and so messed up step 2.

    Any suggestions would be appreciated - and am perfectly willing to remove all traces and do a fresh install but understand that this has to be done correctly or some old config files can mess with a new installation.
    Paul

  2. #2
    Join Date
    May 2012
    Location
    Finland
    Posts
    2,004

    Default Re: phpMyAdmin - loss of root

    If your MySQL installation is indeed completely empty and does not contain anything important, you can completely start fresh with (as root):

    Code:
    systemctl stop mysql
    rm -fr /var/lib/mysql/*
    systemctl start mysql
    mysqladmin -u root password coolnewpassword
    Be *VERY* careful that the rm command is as shown here. It will delete all MySQL databases.

    Replace coolnewpassword with whatever password you wish for the MySQL root user to have.
    .: miuku #suse @ irc.freenode.net
    :: miuku@opensuse.org

    .: h​ttps://download.opensuse.org/repositories/home:/Miuku/

  3. #3

    Default Re: phpMyAdmin - loss of root

    Thank you Miuku.
    Will try that.
    And for others like me - reading a sentance ahead and doing that dangerous thing called thinking - I assume that the very simple command
    rm -fr /var/lib/mysql/*
    removes all the old config files and settings so that the new fresh install is squeeky clean and avoids all the messy "skip-grant-table" and "flush priveleges" stuff ?
    Sorry to question your obvious expertise but wanted to put the text on the screen for others who may be a daft as me.
    Pau/

  4. #4
    Join Date
    May 2012
    Location
    Finland
    Posts
    2,004

    Default Re: phpMyAdmin - loss of root

    The rm command will, literally, delete all files in the mysql database directory and you'll start up with a fresh database, users etc. You must make sure you stop the SQL server before you do this (thus the systemctl stop mysql command)

    Using this on a system where you already have databases would obliterate everything and recovering them unless you have backups would be extremely difficult.

    This is not the 'recommended' way but it's a sure fire way to clean *everything*.
    .: miuku #suse @ irc.freenode.net
    :: miuku@opensuse.org

    .: h​ttps://download.opensuse.org/repositories/home:/Miuku/

  5. #5

    Default Re: phpMyAdmin - loss of root

    Success.
    Thank you once again and for the subsequent explanation/confirmation.
    I now have root access with a new password.
    All grist to the learning mill.
    Paul

Posting Permissions

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