Koozali.org: home of the SME Server

Can't Access Mysql and Can't Find Root Password

Dacky

Can't Access Mysql and Can't Find Root Password
« on: October 15, 2006, 04:03:19 PM »
As root I cannot access mysql from prompt by typing mysql or any combination.  I can access my database with phpmyadmin logging in as admin.

Two programs using the database cannot import records:  Openbiblio and Koha.  Some of this problem could be due to my efforts to install Koha which is working, but I cannot import records.  Even if I give privileges in phpmyadmin to these two users, access to the database is still denied.

I cannot find the root password.  I've seen mention the /root/.my.cnf file.  I cannot find any such file in this directory.  Can it be restored?

I don't want to reinstall the OS if I can help it.  This server is scheduled to go into major use at our school in two weeks and I have been working on getting it ready.  I must have done something wrong along the way.

I've search the forums but nothing is real clear to me.  Thanks for any help.

Offline byte

  • *
  • 2,183
  • +2/-0
Can't Access Mysql and Can't Find Root Password
« Reply #1 on: October 15, 2006, 04:28:52 PM »
Have a look at this to recover you mysql...

http://bugs.contribs.org/show_bug.cgi?id=778

If you search the Bug Track you will find alot of other mysql root stuff...

Link to search in Bug Tracker

http://bugs.contribs.org/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__all__&product=&content=mysql+root+password
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Dacky

Can't Access Mysql and Can't Find Root Password
« Reply #2 on: October 16, 2006, 08:10:16 AM »
Sometimes patience and persistence pay off.  I got this working after some thinking and digging.  

I figured since I could not see a .my.cnf file and that password seemed to be a problem in accessing mysql, something must be wrong with that file.  So I checked the template for /root/.my.cnf.  It looked ok and so did a expand-template for the /root/.my.cnf and got the file back.  I'm not sure why this did not work with a reboot or if I did something wrong along the way.  Anyway, this gave me the .my.cnf file and after that I could access mysql from root and all functionality sees to be great.

One positive thing is that I am learning alot about SME and like the easy recovery that is built into it.  Part of it is just knowing what to look for.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Can't Access Mysql and Can't Find Root Password
« Reply #3 on: October 16, 2006, 08:34:45 AM »
Quote from: "Dacky"
Sometimes patience and persistence pay off.  I got this working after some thinking and digging.  

I figured since I could not see a .my.cnf file and that password seemed to be a problem in accessing mysql, something must be wrong with that file.  So I checked the template for /root/.my.cnf.  It looked ok and so did a expand-template for the /root/.my.cnf and got the file back.  I'm not sure why this did not work with a reboot or if I did something wrong along the way.

normally a reboot will not restore configuration files, this is something you will have to be done explicitly, either by you manually or by the server-manager event firing mechanism.
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)