Koozali.org: home of the SME Server

Mysql root Password SME7

calvin

Mysql root Password SME7
« on: February 28, 2006, 03:40:58 PM »
Hi, i am using sme 7 pre3 everything seems ok, but i can't access mysql
I receive this error :

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I try everything that I found in the forum but nothing until now,

someone have a solutions for this

thanks Calvin

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Mysql root Password SME7
« Reply #1 on: February 28, 2006, 10:07:09 PM »
Quote from: "calvin"
Hi, i am using sme 7 pre3 everything seems ok, but i can't access mysql
I receive this error :

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)



What exactly are you trying to do?

Quote

I try everything that I found in the forum but nothing until now,

someone have a solutions for this


You should start by telling people what you've done to get your system into this state. As it comes out of the box, the root user can access mysql by just typing "mysql" - no need to know or provide a password.

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
ERROR 1045 (28000): Access denied for user 'root'@'localhost
« Reply #2 on: March 01, 2006, 02:06:40 PM »
Same error here... so let explay how I get here:

1) Installed SME7pre3
2) updated it + signal-events (including reboot)
3) mysql < /tmp/mysql.dump (restore of my OLD mysql database)

What I already did:

1) verified that /root/.my.cnf contain a random string ... was not sure if it's my old one of my new one

2) noted as .my.cnf was a template... great!
# /sbin/e-smith/expand-template /root/.my.cnf

everything was the same.

3) If I try to stop mysqld with: /etc/rc.d/init.d/mysql stop it's ok... but restart it ... don't work.

4) If I want it back up I do service mysqld [restart|start]

5) I installed phpmyadmin from http://mirror.contribs.org/smeserver/contribs//dmay/smeserver/7.x/smeserver-phpmyadmin-2.6.4-pl4.dmay.noarch.rpm as by http://forums.contribs.org/index.php?topic=30888.0

but after login I receive exactly same error (1045).




Any help/tip?


Thanks

Jáder
...

Offline kmccarn

  • ***
  • 112
  • +0/-0
Mysql root Password SME7
« Reply #3 on: March 01, 2006, 07:09:37 PM »
Try "passw0rd" (and that's a zero not an O)

 :-o
Kevin in WV 8-)......

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
trying passw0rd
« Reply #4 on: March 01, 2006, 10:57:30 PM »
didn't worked! :(

Any other tip?
...

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
solved mysql password problem
« Reply #5 on: March 02, 2006, 12:17:05 PM »
Hi

After do some search I discovered:
1) This is almost a FAQ (exist at least 2 bugs on bug tracker: 73 & 182)
2) I can see the error message on /var/log/mysqld/current  : it was a old password error!
So I went here: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
as by FAQ to get a solution:

Quote

#

shell> kill cat /mysql-data-directory/host_name.pid

Note the use of backticks rather than forward quotes with the cat command; these cause the output of cat to be substituted into the kill command.
#

Create a text file and place the following command within it on a single line:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');

Save the file with any name. For this example the file will be ~/mysql-init.
#

Restart the MySQL server with the special --init-file=~/mysql-init option:

shell> mysqld_safe --init-file=~/mysql-init &

The contents of the init-file are executed at server startup, changing the root password. After the server has started successfully you should delete ~/mysql-init.
#

You should be able to connect using the new password.



I did the above (created a /tmp/sqlpwd file and started mysqld_safe with init-file=/tmp/sqlpwd&

This changed password to "MyNewPassword'" so I stopped mysql (service mysqld stop), changed MyNewPassword on /tmp/sqlpwd with my random password from /root/.my.cnf and restarted again in safe mode.
Now my MySQL password is the same as on .my.cnf file.
So, I restarted MySQL and everything appears to be ok.
command line mysql AND PHPMyAdmin are working!

Gordon & others: sorry to be crossposting here from BugTracker... I believe  some people will not search on BugTracker (besides to have several bugs with almost same problem). So this document a tested solution.

Jáder
...

Offline gordonr

  • *
  • 646
  • +0/-0
    • http://www.smeserver.com.au/
Re: solved mysql password problem
« Reply #6 on: March 06, 2006, 05:58:45 AM »
Quote from: "jader"

Gordon & others: sorry to be crossposting here from BugTracker... I believe  some people will not search on BugTracker (besides to have several bugs with almost same problem). So this document a tested solution.

People *need* to search the bug tracker - that's where issues are tracked.

Please raise your suggestion in the bug tracker in the SME Server Documentation/FAQ category so that a correct recipe can appear in the FAQ.

The issue is that the manual database restores are overwriting the correct MySQL root password. This is properly dealt with in a system upgrade, but if you restore a database dump with a root password you will break it again.
............

Offline bcliburn

  • **
  • 41
  • +0/-0
Mysql root Password SME7
« Reply #7 on: March 07, 2006, 02:34:07 AM »
I installed it on my 6.5 a long time ago and had the same problem. I am always able to login as admin and use my sme admin password.  It only does that to me on SME though.

micronator

ERROR 1045 (28000): Access denied for user 'root'@'localhost
« Reply #8 on: August 16, 2006, 07:25:02 PM »
I just had the same problem.

- I Upgraded 6.0.1 to 7.0
- I had a lot of problem after that. So I decided to backup everything with the server-manager on a workstation. I use XOOPS. So I decided to use mysqldump to backup my database.
- I installed SME-7.0

- I backup /root directory of the new SME-7.0 to a temp directory. I include all the files even all the . files.
- Then I restored manually from the files in the tar file.
- I restored manually the /root directory, including the .files and I overwrote all the files. even the my.cnf (this was the problem). After that I was no more able to access mysql.

- I search the forum and I found this thread. In it there was somebody saying something about that file.
- I compared the my.cnf that was created with the new SME-7.0 with the one that server-manager backed-up.
- The encrypted passwords were different.
- I put back the my.cnf created with the new SME-7.0 to its original place in /root.

- Victory on the western front. I was now able to access mysql.

So definitively the my.cnf was the problem. :pint:

- I didn't reboot yet... because of
#------------------------------------------------------------
# DO NOT MODIFY THIS FILE! It is updated automatically by the
# e-smith server and gateway software. Instead, modify the source
# template in the /etc/e-smith/templates directory. For more
# information, see http://www.e-smith.org.
#
# copyright (C) 1999-2001 e-smith, inc.
#------------------------------------------------------------

I will send this reply, reboot, and see what will happen

Another funny thing I noticed is the size of my database for XOOPS. There is about 30KB difference between the one I did with mysqldump and the one server-manager did. My web page looks OK. Both backup of the database were done with about 10 minutes difference.

Micronator

micronator

Mysql root Password SME7
« Reply #9 on: August 16, 2006, 07:34:32 PM »
.
Well, I'm back after a reboot.
Again: Victory on the western front.
I am still able to access mysql. :pint:

Micronator.

pcp20us

1045 access problem with phpadmin
« Reply #10 on: November 30, 2006, 04:16:14 AM »
Hello

I am newbie to linux. I have been trying to get php myadmin running for about 2 days. I am confused

Have read a lot and confused myself a lot.

Running sme linux 7.0 I have down local network command to allow acces over the network. I can log in to my sql with command
 mysql -u root. This works

When i try to connect  over the web.
When propmted for username password i have tried root with my root password which is set to admin to log into the console. Is this correct.


I have viewed my /etc/my.cnf file but i don't see any password in there. I have a feeling that there is a problem with the password somewhere. it mentions about a .my.cnf.swp file ???


I have tried grant priveleges to the *.* database but no different
Any help appreciated as i am confused


Cheers


Pete :?:

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Re: 1045 access problem with phpadmin
« Reply #11 on: November 30, 2006, 04:49:32 AM »
Quote from: "pcp20us"



I have viewed my /etc/my.cnf file but i don't see any password in there. I have a feeling that there is a problem with the password somewhere. it mentions about a .my.cnf.swp file ???




Code: [Select]
/root/.my.cnf
Regards,
William

IF I give advise.. It's only if it was me....

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Re: 1045 access problem with phpadmin
« Reply #12 on: November 30, 2006, 04:51:34 AM »
Quote from: "pcp20us"
Hello

I am newbie to linux. I have been trying to get php myadmin running for about 2 days. I am confused



More details required.

Where are you getting phpmyadmin from ?
Regards,
William

IF I give advise.. It's only if it was me....

pcp20us

Mysql root Password SME7
« Reply #13 on: November 30, 2006, 10:48:03 AM »
Hi William

Its good to get an aussie response !!

The phpmyadmin is from here
when i read what u said i remeber reading something about using software that has been tested with sme !!! so maybe this ain't the right phpmyadmin ?? I should check this fist off i suppose.

I tried to go to the irc links in you last post it didn't work. What is an irc link.

Offline william_syd

  • ****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Mysql root Password SME7
« Reply #14 on: November 30, 2006, 10:55:11 AM »
Quote from: "pcp20us"


The phpmyadmin is from here


Here where ?

Install MasterSleepys one........

Code: [Select]
wget http://www.vhconsult.com/download/sme70/phpmyadmin-multiuser/smeserver-phpmyadmin-multiuser-2.9.1.1-1.noarch.rpm

then

Code: [Select]
yum localinstall smeserver-phpmyadmin-multiuser-2.9.1.1-1.noarch.rpm

Login with Username admin and Password admin (admin is the password)

Plenty of 'skips' on the forum.. :)
Regards,
William

IF I give advise.. It's only if it was me....