Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: sandeep on February 22, 2011, 11:18:33 PM

Title: How to retain mysql root password..?
Post by: sandeep on February 22, 2011, 11: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
Title: Re: How to retain mysql root password..?
Post by: gerald_clark on February 23, 2011, 12:16:13 AM
Your mysql database needs to be on persistent storage.
Title: Re: How to retain mysql root password..?
Post by: bmarkus on February 23, 2011, 01:02:22 AM
Your mysql database needs to be on persistent storage.

You can add it to backup also, if size is reasanable.
Title: Re: How to retain mysql root password..?
Post by: jwideman on March 03, 2011, 05: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.
Title: Re: How to retain mysql root password..?
Post by: gutmensch on March 03, 2011, 06: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
Title: Re: How to retain mysql root password..?
Post by: gerald_clark on March 03, 2011, 07:03:37 PM
Better yet, modify the my.cnf file, and define the data path to be on persistent storage.
Title: Re: How to retain mysql root password..?
Post by: bmarkus on March 04, 2011, 01:23:12 AM
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.