Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
well it seemed like good advice, and perhaps somewhere else it may work.
I followed the steps in 1.4.1.2. Resetting the Root Password on Unix Systems
obviously substituting parameters such as
I must say its confusing having users like "root" on a system that root has a specific meaning to.
its been a long day with zero productivity and I got Oracle going in less than 1/4 the time.
perhaps my installation has something squiff about it ... but I am past caring now its too late.
another day
thanks for the contributions however
No, nothing wrong with it, but I do think you missed alot of what people were telling you.
The "-u" parameter, where you kept keying in mysql, meant you were LOGGING IN TO MYSQL as that user. If you had done (as root), "mysql", that would have been it. You'd have connected as the root user to MySQL, and been able to do whatever you'd have liked. You didn't have to reset your unix password, or do anything else.....
Here another example don't give up just try again and maybe read the whole thread again. And just to go over again users in mysql are different then the users on your linux system.
HOWTO RESET ROOT PASS OF MYSQL USER root:
1. First things first. Log in as root and stop the mysql daemon. Now lets start up the mysql daemon and skip the grant tables which store the passwords.
Code:
mysqld_safe --skip-grant-tables
You should see mysqld start up successfully. If not, well you have bigger issues. Now you should be able to connect to mysql without a password. Then in a new terminal:
Code:
mysql --user=root mysql
Code:
update user set Password=PASSWORD('new-password') where user='root';
flush privileges;
exit;
Of course replace the "new-password" with your new password. Now kill your running mysqld, then restart it normally. You should be good to go. Try not to forget your password again.
Be sure to read the section on securing mysql after installing.
use mysql;
select Host, User, password from user;
Make sure the password field isn't blank for the root user account when you are done following the last post.
thanks for that suggestion ... it may come in handy in the future.
and I haven't forgotten my password, I'm just trying to use the instance which was set up by the Redhat installation disk (as I mentioned in my first post).
The "-u" parameter, where you kept keying in mysql, meant you were LOGGING IN TO MYSQL as that user. If you had done (as root), "mysql", that would have been it.
well, actually I did do that. I chose not to report EVERY attempt at what I tried typing in some 4 hours as I thought it might make too much to read.
I also tried updating the conf files with user=root ...
You should see mysqld start up successfully. If not, well you have bigger issues. Now you should be able to connect to mysql without a password. Then in a new terminal:
Code:
mysql --user=rootmysql
Code:
update user set Password=PASSWORD('new-password') where user='root';
flush privileges;
exit;
Of course replace the "new-password" with your new password. Now kill your running mysqld, then restart it normally. You should be good to go. Try not to forget your password again.
now that is interesting ... first time I've seen both words passed in as user...
Hi
now that is interesting ... first time I've seen both words passed in as user...
Let me break it down "mysql --user=root mysql":
- first mysql is the command to start the shell.
- then --user=root to specify what user I want to connect as.
- the last mysql to specify what database I want to use.
I found it a lot easier to use the MySQL GUI Administrator program to create users, rights and from where connections are allowed. It's the last part that I sometimes have difficulties with. I only allow root connections locally, so I "ssh -X" from my laptop to my desktop, and launch the mysql administrator program from the terminal remotely. (Even though I'm someone who often sed to modify the /etc/fstab file)
Actually, if your distro installs the root account with a password initially, that would be a good thing. Some users install it and that's that, leaving their server extremely vulnerable. I follow the procedures in the MySQL manual's security section, the first thing after installing the MySQL package.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.