Koozali.org: home of the SME Server

MySQL Password after desktop restore

Offline mike_mattos

  • *
  • 313
  • +0/-0
MySQL Password after desktop restore
« on: May 28, 2009, 07:53:00 PM »
just installed 7.4 on an intel atom board with twin 2.5 drives, applied all updates, copied smeserver.tgz backup from my desktop to /, tar xvzf smeserver.tgz and had all my ibays and users back to life

BUT

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

Search shows several fixes but they seem to be for 7.3 or MySQL 4, or not to work, suggestions welcome
...

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: MySQL Password after desktop restore
« Reply #1 on: May 28, 2009, 08:26:53 PM »
just installed 7.4 on an intel atom board with twin 2.5 drives, applied all updates, copied smeserver.tgz backup from my desktop to /, tar xvzf smeserver.tgz ...

That's not a proper process for doing a restore. A proper restore process includes running signal-event multiple times, with at least pre-restore, post-upgrade and reboot options. I'm sure it's documented here.

Offline mike_mattos

  • *
  • 313
  • +0/-0
Re: MySQL Password after desktop restore
« Reply #2 on: May 28, 2009, 09:15:25 PM »
I scoured the docs, restore from desktop was removed with 7.4 with some comments about following the prompts during install, but I didn't see any !  I looked at a Red Hat posting for the tar info.

Good news is, the following SME script worked when I retried it after some reboots and other attempts


From SME docs, note that I was using SME 7.4 and MySQL 4.1.22
Restoring accidently deleted MySQL root user

Note: The following is only applicable on SME 7.3 and MySQL 4.1

cd /var/service/mysqld
sv d .
echo 'use mysql;'>set.rootuser
echo -n 'INSERT INTO user VALUES("localhost","root","",'>>set.rootuser
echo '"Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","Y","","","","",0,0,0);'>>set.rootuser
expand-template /root/.my.cnf
expand-template /var/service/mysqld/set.password
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < set.rootuser
/usr/libexec/mysqld --bootstrap --user=mysql --skip-grant-tables < set.password

Thanks for the reply Charlie, it got me searching again & I decided to retry the script after a clean boot.


...

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: MySQL Password after desktop restore
« Reply #3 on: May 28, 2009, 11:32:13 PM »
mike_mattos

Documented here in a reasonably obvious place, considereing the procedure you followed is non standard:

http://wiki.contribs.org/Backup_server_config#Command_line_manual_Restore_from_USB_drive_or_memory_stick
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline mike_mattos

  • *
  • 313
  • +0/-0
Re: MySQL Password after desktop restore
« Reply #4 on: May 29, 2009, 04:30:38 PM »
Mary, the page you quote IS the answer to my problem, but not an obvious solution.  ( and was off screen! )

It is the sixth item and after known problems, truthfully I read all the manual references and was lead to believe that the procedure was obsolete since restore from desktop was no longer on the Server Manager.

Charlie, not sure how I could modify the documentation to reflect that backup to desktop is still a viable way to proceed for small systems.     I'm on the doc's team but have to date only reported issues, I can submit a revised page if it helps.

« Last Edit: May 29, 2009, 05:00:22 PM by mike_mattos »
...