Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a CentOS 5.6 x86 installed. I have full access to mysql but it seems I have forgotten Linux root password. How I can access the root via MySQL? Is it even possible? Update: MySQL Version is 5.0.77

share|improve this question

1 Answer 1

I am not a MySQL expert but I don't believe that MySQL allows you to execute arbitrary (shell) commands.

Furthermore MySQL would have to run as root which I hope it doesn't.

So in order to achieve that you would probably need two exploits: One hacking MySQL itself and giving you shell access and another for becoming root: a local root exploit (privilege escalation). You probably don't want to do either of them.

You can easily reset the password by booting the system with the kernel parameter init=/bin/bash or by booting from another medium (CD/DVD/USB), chrooting into the installed system and call passwd there.

But the whole story seems strange to me. Who does not have SSH access with keys instead of a password?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.