How to reset forgotten mysql root password?


 
Thread Tools Search this Thread
Operating Systems Solaris How to reset forgotten mysql root password?
# 1  
Old 02-09-2014
[Solved] How to reset forgotten mysql root password?

Hi All,

I just found one thread on this forum on this subject here:

Forgot MYSQL password root | Unix Linux Forums | Web Development

but unfortunately the issue was not resolved.

I have the same problem with the same error message.
The background is that I built a Solaris 11 x86 server (using Solaris 11 Live DVD hard drive install option) for using as a test web server on my local LAN. I was amazed at how simple this was to "throw on" MySQL, Apache, PHP, and other prerequisites. I then installed Wordpress and it just worked. Unfortunately, in the rush to get it running I didn't note the MySQL root password that I used.

NOTE TO MODERATOR: If this would get a better response on a forum other than Solaris please do move it.

I haven't looked for or tried solutions found on Google yet. I just thought I'd put it on this great forum first.

I have modified the role of the root user to "normal". Obviously, I have physical hardware access, console root login access, etc.
Anybody know how to get back into MySQL in these circumstances?
Thanks in advance

Last edited by hicksd8; 02-09-2014 at 10:24 AM..
# 2  
Old 02-09-2014
But you have root access to the machine? If so, then you can simply run "mysql" as root user, then change whichever user's password you need to change.
# 3  
Old 02-09-2014
Perhaps I haven't made myself clear.

It's the MySQL database root password that I'm trying to change (not the password of the MySQL system user).

Yes, I can login to the system as root. I know how to change any user's password. I've told many a member on this forum how to boot from DVD and reset root passwords.

I know plenty about Solaris but I'm dumb on MySQL.

You will need to spell it out clearly as I'm no MySQL expert.

Thanks.
# 4  
Old 02-09-2014
What happens when you execute "mysql" as Solaris root user? Do you get MySQL prompt?
# 5  
Old 02-09-2014
Yes, I do.
# 6  
Old 02-09-2014
Then you should be able to do this (from https://dev.mysql.com/doc/refman/5.5...rmissions.html
Code:
UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root'; FLUSH PRIVILEGES;

This User Gave Thanks to bartus11 For This Post:
# 7  
Old 02-09-2014
That gives the error:

Code:
 
 ERROR 1046 (3D000): No database selected
 Query OK, 0 rows affected (0.00sec)

I've tried to reinstall Wordpress on the platform but it asks for password for root@localhost but I don't remember what I set it to when I installed MySQL.

If I run

Code:
 
 /usr/mysql/5.1/bin/mysql_install_db

it also asks for password for root@localhost and I've forgotten it.

Am I correct in assuming that MySQL database user password are stored inside the database (like Oracle)?

On install of Solaris 11, it set me up a personal userid/password and the root role password was the same password. Since installation I've modified the root role to a normal user and then changed the root user password. Would any of that have screwed up or changed the MySQL authentication? If database user passwords are stored inside the database then I assume not?

I need to go and study that link you posted and understand MySQL much better. Homework needs to be done.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Linux root Password Reset

Hi , I ve a question about the Linux system root password change. Which can be done using grub menu without inputting the old password.:confused: So If anybody can change the root password without any password and then how it is secure. Anybody can manipulate the other user using the... (6 Replies)
Discussion started by: pradyumnajpn10
6 Replies

2. Solaris

solaris 8 reset root password from OSX

Hello, I have two old Solaris machines $ uname -a SunOS unknown 5.8 Generic_117350-39 sun4u sparc SUNW,UltraAX-e2 unfortunately, it has been so long ago that i have used these that the root password has left my head... i can log into one of the machine as a normal user, but am unable to... (4 Replies)
Discussion started by: Norman Khine
4 Replies

3. UNIX for Dummies Questions & Answers

Forgotten root password

I forgot the password of root and i dont know "How to reset root password without loosing of my previous data and users." (5 Replies)
Discussion started by: yashwanthguru
5 Replies

4. Emergency UNIX and Linux Support

Reset AIX root password without shutting down the system

Hi All, I'm stuck in a severe problem here , Someone have changed the root password and he cannot remember it and there is no other user privileged user on the system , But I do have access to a non privileged user. On the top of the system an application which requires a theoretical ... (5 Replies)
Discussion started by: h@foorsa.biz
5 Replies

5. Red Hat

Fedora reset root password

I need some help with Fedora. I am trying to reset the root password. When I tried to login I was not able to. I kept getting the authentication failure message. I got the password reset success message. passwd: all authentication tokens updated successfully. I then thought maybe the root... (6 Replies)
Discussion started by: cokedude
6 Replies

6. UNIX for Advanced & Expert Users

How to reset the ldap root password?

How to change the ldap root password. I have generated the password by using "slappasswd " command, but In my root machine "/etc/ldap/sldap.d" file is not there. instead of the file sldap.d directory only is there. please help me...? (0 Replies)
Discussion started by: ungalnanban
0 Replies

7. Solaris

Reset lost superuser/root password in x86

I've come across this question during interview as Sys Adm. "How you reset lost root/superuser password on x86 system running solaris (8/9/10) which remotely located. (Not locally in front of you)" As much as I know, you must be physically in front of the server to reset the lost... (4 Replies)
Discussion started by: shahru
4 Replies

8. UNIX for Advanced & Expert Users

Not able to reset mysql root password

Hi, My root password for mysql has some problem as it dosent allow me to login.... all commands to reset it failed. so I removed mysql yum remove mysql and installed it by yum install mysql mysql-devel mysql-server and it installed fine I gave chkconfig --levels 235 mysqld on... (1 Reply)
Discussion started by: viji19812001
1 Replies

9. Cybersecurity

How to reset root password of old Unix System V

Hi all, This is first time I met unix in my life. I purchased old Scanning Elecron Microscope which came with 486/33MHz PC running Unix System V, ver. 3.6. The one simple user name/passw is known so I can boot and login. But can not shutdown! It asks root or su passw. I'm very sensitive not to... (6 Replies)
Discussion started by: 82026
6 Replies

10. UNIX for Advanced & Expert Users

Root password forgotten

If someone a Unix system administrator forgets the root password ?. What will be the consequences ?. Should the OS needs to be reinstalled ?? (6 Replies)
Discussion started by: dhanamurthy
6 Replies
Login or Register to Ask a Question