WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to retain mysql root password..?  (Read 2833 times)

Offline sandeep

  • Newbie
  • *
  • Posts: 19
How to retain mysql root password..?
« on: February 22, 2011, 08:18:33 PM »
Hello

I tried setting mysql root password by command

mysqladmin -u root password 'root'

and i backed up but when i reboot the machine and try to login by the command

mysql -u root -p it asks for mysql passowrd and when i entered the password that i had set its showing me access denied the problem is i am loosing the password after reboot!!!! :P

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to retain mysql root password..?
« Reply #1 on: February 22, 2011, 09:16:13 PM »
Your mysql database needs to be on persistent storage.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: How to retain mysql root password..?
« Reply #2 on: February 22, 2011, 10:02:22 PM »
Your mysql database needs to be on persistent storage.

You can add it to backup also, if size is reasanable.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline jwideman

  • Newbie
  • *
  • Posts: 1
Re: How to retain mysql root password..?
« Reply #3 on: March 03, 2011, 02:06:13 PM »
Your mysql database needs to be on persistent storage.
I've been trying to figure out how to do this myself. Can you give more detailed help? I know where to move it to, but when the VM reboots /usr/local/var/mysql gets recreated and mysql thinks that's where the database is.
/usr/local/etc/my.cnf is on the backup and has the database set to /mnt/hda1/database/mysql - but mysql ignores this on reboot.

Offline gutmensch

  • Administrator
  • Hero Member
  • *****
  • Posts: 605
  • I can make it disappear, have no fear!
    • remembrance blog
Re: How to retain mysql root password..?
« Reply #4 on: March 03, 2011, 03:06:51 PM »
IIRC the mysql extension still overwrites files on installation, which will happen after restore of backup... would be good to have an updated version, which checks for files and doesn't copy them over, if there are already some in place.

until that is the case you can store and dump your database in a separate archive like backup.tar.gz, put it on /mnt/hda1/ and restore it from /opt/bootsync.sh like

mysqladmin shutdown
tar xzf backup.tar.gz -C /
mysqld_multi start 1
If I seem unduly clear to you, you must have misunderstood what I said. (Alan Greenspan)

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to retain mysql root password..?
« Reply #5 on: March 03, 2011, 04:03:37 PM »
Better yet, modify the my.cnf file, and define the data path to be on persistent storage.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: How to retain mysql root password..?
« Reply #6 on: March 03, 2011, 10:23:12 PM »
IIRC the mysql extension still overwrites files on installation, which will happen after restore of backup... would be good to have an updated version, which checks for files and doesn't copy them over, if there are already some in place.

until that is the case you can store and dump your database in a separate archive like backup.tar.gz, put it on /mnt/hda1/ and restore it from /opt/bootsync.sh like

mysqladmin shutdown
tar xzf backup.tar.gz -C /
mysqld_multi start 1

Well, it is rather old. I will update in a week hopefully.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."