Unix Technical Forum

Problem on creating root password

This is a discussion on Problem on creating root password within the MySQL General forum forums, part of the MySQL category; --> > Typing either "mypassword" or "YES" prompted; > mysqladmin: connect to server at 'localhost' failed > error: 'Access denied ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 02-28-2008, 06:06 AM
satimis
 
Posts: n/a
Default Re: Problem on creating root password



> Typing either "mypassword" or "YES" prompted;
> mysqladmin: connect to server at 'localhost' failed
> error: 'Access denied for user 'root'@'localhost' (using password: YES)'
> * end *


That is asking for your *old* password.
[/quote]

I did not create password before. This is a new installation. I'm tuning
it.

Stephen Liu
--
View this message in context: http://www.nabble.com/Problem-on-cre....html#a9728432
Sent from the MySQL - General mailing list archive at Nabble.com.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 02-28-2008, 06:06 AM
Stephen Liu
 
Posts: n/a
Default Re: Problem on creating root password


--- Chris <dmagick@gmail.com> wrote:

>
> > Retried as follows;
> >
> > [root@server ~]# mysqladmin -u root --password mypassword
> > Enter password:
> >
> >
> > Typing either "mypassword" or "YES" prompted;
> > mysqladmin: connect to server at 'localhost' failed
> > error: 'Access denied for user 'root'@'localhost' (using password:

> YES)'
> > * end *

>
> That is asking for your *old* password.


I did not create any password before. This is a new installation. I'm
tuning it.


B.R.
Stephen Liu

Send instant messages to your online friends http://uk.messenger.yahoo.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 02-28-2008, 06:06 AM
Chris
 
Posts: n/a
Default Re: Problem on creating root password

satimis wrote:
>
>> Typing either "mypassword" or "YES" prompted;
>> mysqladmin: connect to server at 'localhost' failed
>> error: 'Access denied for user 'root'@'localhost' (using password: YES)'
>> * end *

>
> That is asking for your *old* password.
> [/quote]
>
> I did not create password before. This is a new installation. I'm tuning
> it.


Try this:

mysqladmin -u root password xyz

That will change your password to 'xyz'.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14 (permalink)  
Old 02-28-2008, 06:06 AM
Stephen Liu
 
Posts: n/a
Default Re: Problem on creating root password

--- Chris <dmagick@gmail.com> wrote:

- snip -

> Try this:
>
> mysqladmin -u root password xyz
>
> That will change your password to 'xyz'.
>



Before received this email I tried;

[root@server ~]# mysqladmin -u root -p
mysqladmin Ver 8.41 Distrib 4.1.20, for redhat-linux-gnu on x86_64
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Administration program for the mysqld daemon.
Usage: mysqladmin [OPTIONS] command command....
-c, --count=# Number of iterations to make. This works with -i
(--sleep) only.
-#, --debug[=name] Output debug log. Often this is 'd:t,filename'.
-f, --force Don't ask for confirmation on drop database; with
multiple commands, continue even if an error
occurs.
-C, --compress Use compression in server/client protocol.
--character-sets-dir=name
Directory where character sets are.
--default-character-set=name
Set the default character set.
-?, --help Display this help and exit.
-h, --host=name Connect to host.
-p, --password[=name]
......
......
......
[root@server ~]#


[root@server ~]# mysqladmin -u root password xyz
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
* end *


Stephen

Send instant messages to your online friends http://uk.messenger.yahoo.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15 (permalink)  
Old 02-28-2008, 06:06 AM
Chris
 
Posts: n/a
Default Re: Problem on creating root password

> [root@server ~]# mysqladmin -u root password xyz
> mysqladmin: connect to server at 'localhost' failed
> error: 'Access denied for user 'root'@'localhost' (using password: NO)'
> * end *



So you *have* set the root password before.

From your previous emails:

# mysqladmin -u root password yourrootsqlpassword

That set the password to "yourrootsqlpassword".



If you need to reset it, see documentation:

http://dev.mysql.com/doc/refman/4.1/...rmissions.html


As a final recourse, remove & re-install mysql from your server.

If you have no data, then that might be the quickest & easiest.

If you do have data, that's something else entirely.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16 (permalink)  
Old 02-28-2008, 06:06 AM
Maciej Dobrzanski
 
Posts: n/a
Default Re: Problem on creating root password

In news:9717062.post@talk.nabble.com,
satimis <satimis@yahoo.com> wrote:

> [root@server ~]# /etc/init.d/mysqld restart
> Stopping MySQL: [FAILED]
> Starting MySQL: [ OK ]


Ok, lets try it a different way, using only the above script to start/stop
the database. Find your MySQL configuration file. It's called 'my.cnf' and
usually is located in either /etc or /etc/mysql directory. Edit the file and
in [mysqld] section add:

skip-grant-tables

Then, execute the init script:

# /etc/init.d/mysqld restart

The database should start without privileges.
After setting up password, remove 'skip-grant-tables' parameter from the
config file and restart MySQL again.

Maciek

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17 (permalink)  
Old 02-28-2008, 06:06 AM
Stephen Liu
 
Posts: n/a
Default Re: Problem on creating root password

--- Chris <dmagick@gmail.com> wrote:

- snip -

> So you *have* set the root password before.
>
> From your previous emails:
>
> # mysqladmin -u root password yourrootsqlpassword
>
> That set the password to "yourrootsqlpassword".
>
>
>
> If you need to reset it, see documentation:
>
> http://dev.mysql.com/doc/refman/4.1/...rmissions.html



I tried learning resetting the password according to above URL. I
can't find "set" command on this box. I don't know which package
provides it so finally I surrendered.



> As a final recourse, remove & re-install mysql from your server.
>
> If you have no data, then that might be the quickest & easiest.


I have no data as this is a new installation for learning.


# yum groupremove mysql
It went throught w/o complaint.


# yum install mysql mysql-devel mysql-server
Also went through w/o complaint


# nano /etc/init.d/mysqld
changed;
restart(){
stop
start
}
*end*


to;
restart(){
stop
sleep 3
start
}
*end*


# chkconfig --levels 235 mysqld on
No complaint

# /etc/init.d/mysqld start
Starting MySQL: [ OK ]

# netstat -tap
tcp 0 0 *:mysql *:*
......
*end*


# mysqladmin -u root password myrootpassword
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
*end*


Still the same


B.R.
satimis

Send instant messages to your online friends http://uk.messenger.yahoo.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18 (permalink)  
Old 02-28-2008, 06:06 AM
Duncan Hill
 
Posts: n/a
Default Re: Problem on creating root password

On Thursday 29 March 2007 11:38:21 Stephen Liu wrote:

> > http://dev.mysql.com/doc/refman/4.1/...rmissions.html

>
> I tried learning resetting the password according to above URL. I
> can't find "set" command on this box. I don't know which package
> provides it so finally I surrendered.


'set' is a mysql command, used inside the mysql command line tool, not from
your shell prompt.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:33 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com