Issue
I accidentally removed the user you set up when installing mysql (Using DROP USER
), I was assuming that if I created another 'root'@'localhost'
user I would get the permissions back aswell. but it was not the case after I created the user it had no permissions and I tried removing mysql with apt-get autoremove mysql-server
and then reinstalling but I wasnt prompted the 'set password' promt.
Is there any way I can take the master user back without just reinstalling linux?
Solution
Creating the user alone is not sufficient. You also need to grant the privileges as described in this answer and the docs with WITH GRANT OPTION
.
Basically this:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION;
Like that you do not loose the data in your database, which would be the case if you used apt purge
to remove mysql completely.
Answered By - toydarian Answer Checked By - Marilyn (WPSolving Volunteer)