LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-26-2009, 03:54 PM   #16
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,685

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972

Quote:
Originally Posted by pellicle View Post
Hi

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.....
 
Old 07-26-2009, 07:33 PM   #17
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
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.
 
Old 07-27-2009, 01:36 AM   #18
pellicle
Member
 
Registered: Jul 2008
Location: Finland
Distribution: RHEL4
Posts: 139

Original Poster
Rep: Reputation: 15
Ohh ... and
Quote:
Originally Posted by jschiwal View Post
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).

It has not been able to work ever.

Last edited by pellicle; 07-27-2009 at 01:43 AM.
 
Old 07-27-2009, 01:39 AM   #19
pellicle
Member
 
Registered: Jul 2008
Location: Finland
Distribution: RHEL4
Posts: 139

Original Poster
Rep: Reputation: 15
Hi

Quote:
Originally Posted by TB0ne View 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 ...
 
Old 07-27-2009, 01:41 AM   #20
pellicle
Member
 
Registered: Jul 2008
Location: Finland
Distribution: RHEL4
Posts: 139

Original Poster
Rep: Reputation: 15
Hi

Quote:
Originally Posted by micxz View Post
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.
now that is interesting ... first time I've seen both words passed in as user...
 
Old 07-27-2009, 01:49 AM   #21
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Quote:
Originally Posted by pellicle View Post
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.
 
Old 07-27-2009, 03:19 AM   #22
pellicle
Member
 
Registered: Jul 2008
Location: Finland
Distribution: RHEL4
Posts: 139

Original Poster
Rep: Reputation: 15
Hi

Quote:
Originally Posted by micxz View Post
- the last mysql to specify what database I want to use.
thanks for taking the time to explain that .... it wasn't clear that this effected "use mysql" bypassing a first statement in mysql

thanks

as of this morning I remain unable to connect as:

Quote:
mysql --user=root
but maybe if I put
Quote:
mysql --user=root mysql
on the commandline that will work.

(ps there were no previous claims of me being an expert)

Last edited by pellicle; 07-27-2009 at 03:21 AM.
 
Old 07-27-2009, 03:26 AM   #23
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
You still need the -p flag to use a password. Unless you started mysql with --skip-grant-tables as I suggested above to reset the root pass.
 
Old 07-27-2009, 08:56 PM   #24
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Another FYI.

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.

Good Luck!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot login to mysql swmok Linux - Software 3 06-20-2007 11:02 PM
cannot login in MYSQL rajeshdogra Linux - Software 9 01-01-2006 09:15 AM
Can not login into mysql. saudoi Solaris / OpenSolaris 1 11-30-2005 02:20 AM
mysql login Ab3n Linux - Newbie 2 07-04-2005 10:45 AM
mysql login sopiaz57 Linux - Security 1 01-05-2004 10:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration