Koozali.org: home of the SME Server

How to Restore root Access to mysql?

jbrice

How to Restore root Access to mysql?
« on: July 09, 2004, 12:02:38 PM »
I have sudddenly lost root access to mysql on a V6.0 SME Server installation.  :-(
Logging on as root, thus:
Code: [Select]
[root@***** root]# mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)
Likewise I can no longer log on as "admin" using phpMyAdmin, as I could hitherto.

I don't know what I could have done to cause this, and it's not the result of external hacking as the machine in question is on a well protected home network.

The bottom line is that I would appreciate some suggestions from you more experienced guys as to how I could correct this situation.

Thanks in anticipation.
JB

calvin

Reset mysql password
« Reply #1 on: July 09, 2004, 04:30:16 PM »
To reset mysql password -

root@e-smith /root # /etc/rc.d/init.d/mysqld stop
root@e-smith /root # /etc/e-smith/events/actions/conf-mysql-password
root@e-smith /root # /etc/rc.d/init.d/mysqld start

jbrice

Reset mysql password
« Reply #2 on: July 09, 2004, 05:21:17 PM »
Excellent! That's done the job.
Many Thanks.
JB

mackayr

Re: Reset mysql password
« Reply #3 on: December 12, 2006, 05:32:42 AM »
Quote from: "calvin"
To reset mysql password -

root@e-smith /root # /etc/rc.d/init.d/mysqld stop
root@e-smith /root # /etc/e-smith/events/actions/conf-mysql-password
root@e-smith /root # /etc/rc.d/init.d/mysqld start


Is there a way to do this in SME 7?

I recently did a complete fresh install of SME 7 on another server, and tried to restore my complete backup.  Although mostly everything works (ie. users, ibays), my Joomla website does not.  I trust that it's related to the fact that I cannot run mysql under root ... it seems that somehow in the reinstall, the root password got changed.  Perhaps the restore of the backup doesn't overwrite the one that was created when I installed fresh on the new machine?  I think I can solve my problem with Joomla, but will need mysql access to do so.

Please let me know if there's an equivalent command for SME 7 to the middle line above.

Thanks,

Rob

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Reset mysql password
« Reply #4 on: December 12, 2006, 08:53:01 AM »
Quote from: "mackayr"
Quote from: "calvin"
To reset mysql password -

root@e-smith /root # /etc/rc.d/init.d/mysqld stop
root@e-smith /root # /etc/e-smith/events/actions/conf-mysql-password
root@e-smith /root # /etc/rc.d/init.d/mysqld start


Is there a way to do this in SME 7?

I recently did a complete fresh install of SME 7 on another server, and tried to restore my complete backup.  Although mostly everything works (ie. users, ibays), my Joomla website does not.  I trust that it's related to the fact that I cannot run mysql under root ... it seems that somehow in the reinstall, the root password got changed.  Perhaps the restore of the backup doesn't overwrite the one that was created when I installed fresh on the new machine?  I think I can solve my problem with Joomla, but will need mysql access to do so.

Please let me know if there's an equivalent command for SME 7 to the middle line above.

Thanks,

Rob
Yes there is: bug 778, comment 6. I hope you do not run your joomla installation as root, but that you created a separate user for it with the right privileges as the root account has way to much privileges for a application account.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

mackayr

How to Restore root Access to mysql?
« Reply #5 on: December 12, 2006, 12:55:55 PM »
OK.  I got the root password reset.  However, I'm not sure what you mean about running Joomla installation as root.  All there is to the installation is dumping the files into the ibay (I've set up a separate ibay for the website that I can access using my username), changing file permissions, and setting up the database.  I'm not aware of how to change file permissions or setting up the mysql database without using root (or having my user account su into it).  Either case requires providing root password to a user.  Is there a safer way?

Rob

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
How to Restore root Access to mysql?
« Reply #6 on: December 12, 2006, 01:58:48 PM »
Quote from: "mackayr"
OK.  I got the root password reset.  However, I'm not sure what you mean about running Joomla installation as root.  All there is to the installation is dumping the files into the ibay (I've set up a separate ibay for the website that I can access using my username), changing file permissions, and setting up the database.

What I ment is that you should create a seperate mysql user for Joomla to access the Joomla database in MySQL. You should not use the mysql root user (with the 76 charachters randomized cryptic password) for this.
Quote from: "mackayr"
I'm not aware of how to change file permissions or setting up the mysql database without using root (or having my user account su into it).  Either case requires providing root password to a user.  Is there a safer way?

The mysql root user has nothing to do with the normal users you configure on your server. The mysql root user is a special account for mysql with a very high level of privileges analog to the linux root user.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

mackayr

How to Restore root Access to mysql?
« Reply #7 on: December 12, 2006, 07:07:25 PM »
Ah!  Gotcha.  Yes, that is correct.  I did set up a mysql user account for that purpose and used that when setting up Joomla.  Once upon a yester-year I tried to use the root password, and reset it myself, thinking it had gotten corrupted or something.  After being tactfully rebuked by the powers that be in this forum, I found out how to reset the password, and never, ever touched it again.  Sometimes I just have to learn things the hard way, I guess.

Thanks for the info!

Rob