R4nk3d Posted October 30, 2008 Share Posted October 30, 2008 Ok guys. So ive had mysql installed for a while now on my debian server and im starting to host a couple sites off it but theres 1 MAJOR problem. I dont have a root username. I have a username, but its debian-sys-maint and it doesnt have all priviledges like add user. so im stumped. Ive looked everywhere for some help and i cant find any. So can anyone tell me how to get a root username back on the server? Quote Link to comment Share on other sites More sharing options...
trq Posted October 30, 2008 Share Posted October 30, 2008 Have you tried actually loggin in as root? If you haven't yet set a password this should get you in.... mysql -uroot Quote Link to comment Share on other sites More sharing options...
R4nk3d Posted October 30, 2008 Author Share Posted October 30, 2008 Have you tried actually loggin in as root? If you haven't yet set a password this should get you in.... mysql -uroot yes, i have. ive had this installed for a while and i think somehow the password got changed or the user got deleted so how do i get it back/reset it? Quote Link to comment Share on other sites More sharing options...
trq Posted October 30, 2008 Share Posted October 30, 2008 Well, providing you have an account that has enough permissions to add users you could simply add a new user for root. Otherwise, your out of luck I'm afraid. Quote Link to comment Share on other sites More sharing options...
R4nk3d Posted October 30, 2008 Author Share Posted October 30, 2008 Well, providing you have an account that has enough permissions to add users you could simply add a new user for root. Otherwise, your out of luck I'm afraid. i dont. so, do i have to reinstall it? Quote Link to comment Share on other sites More sharing options...
trq Posted October 30, 2008 Share Posted October 30, 2008 As far as I know, yes. You might want to make sure next time either not to delete the root account. Remember the root accounts password, or make sure you setup at least one other user with full rights. Quote Link to comment Share on other sites More sharing options...
R4nk3d Posted October 30, 2008 Author Share Posted October 30, 2008 Ok, thanks. Is there a way to install it using like apt-get install mysql-server instead of like manually reinstalling it? Quote Link to comment Share on other sites More sharing options...
trq Posted October 30, 2008 Share Posted October 30, 2008 Yes. apt-get update && apt-get install mysql-server Quote Link to comment Share on other sites More sharing options...
R4nk3d Posted October 30, 2008 Author Share Posted October 30, 2008 ok, so that will replace my /etc/mysql/ folder and reinstall it? Quote Link to comment Share on other sites More sharing options...
trq Posted October 30, 2008 Share Posted October 30, 2008 No, it won't touch anything within /etc. /etc is where you store configuration data, one of dpkg (apt's packend) main objectives is NOT to overight users configuration data with prompting. It will however install mysql server if it has not already been installed via apt. Quote Link to comment Share on other sites More sharing options...
trq Posted October 30, 2008 Share Posted October 30, 2008 Did you originally install mysql manually? ie; Build from source? Quote Link to comment Share on other sites More sharing options...
R4nk3d Posted October 30, 2008 Author Share Posted October 30, 2008 no, i used apt-get Quote Link to comment Share on other sites More sharing options...
trq Posted October 30, 2008 Share Posted October 30, 2008 So use.... apt-get update && apt-get install --reinstall mysql-server Quote Link to comment Share on other sites More sharing options...
trq Posted October 30, 2008 Share Posted October 30, 2008 Actually... don't! You may be able to reconfigure. Give me two seconds. Quote Link to comment Share on other sites More sharing options...
R4nk3d Posted October 30, 2008 Author Share Posted October 30, 2008 k. waiting Quote Link to comment Share on other sites More sharing options...
trq Posted October 30, 2008 Share Posted October 30, 2008 Assuming you haven't actually deleted the root account, just can't remember the password. You can reconfigure mysql server via dpkg-reconfigure. dpkg-reconfigure mysql-server-5.0 Quote Link to comment Share on other sites More sharing options...
R4nk3d Posted October 30, 2008 Author Share Posted October 30, 2008 ok, well it gave me the screen and i changed it but it still wont login. and when i reinstall it, it doesnt restore the default root username. Quote Link to comment Share on other sites More sharing options...
trq Posted October 30, 2008 Share Posted October 30, 2008 Ok, you may have actually removed the root user. It would seem you'll need to purge it then reinstall. apt-get remove --purge mysql-server && apt-get install mysql-server Quote Link to comment Share on other sites More sharing options...
R4nk3d Posted October 30, 2008 Author Share Posted October 30, 2008 ok, that worked but i had to change it to mysql-server-5.0 Quote Link to comment Share on other sites More sharing options...
fenway Posted October 31, 2008 Share Posted October 31, 2008 You could always have started the server and skipped grants. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.