on 02/27/2004 09:53 AM, Adam Hardy at [EMAIL PROTECTED] wrote:

> On 02/26/2004 09:02 AM Scott Haneda wrote:
>> As per the reco of someone on this list, I created a bash script that runs
>> once a day to do the following:
>> 
>> # set path to final destination
>> location="/Volumes/foo/sql_dumps/"
>> 
>> # set db_list to the list of databases
>> db_list=`echo "show databases" | /usr/local/mysql/bin/mysql -N -u****
>> -p****`
>> 
>> for db in $db_list;
>> do
>>  echo "dumping " $db "to " $location$db.sql
>>  /usr/local/mysql/bin/mysqldump -u**** -p**** --opt $db > $location$db.sql
>> done
>> 
>> echo "changing to directory " $location
>> cd $location
>> echo "Now in:"
>> pwd
>> 
>> echo "begin gzipping and tarballing"
>> tar -zcf $location$time.tar.gz *.sql
>> 
>> echo "removing:"
>> ls -la $location*.sql
>> rm $location*.sql
>> 
>> 
>> echo "All your MySql Database are Belong to Us";
>> echo $location$time.tar.gz
>> 
>> The first thing I would like to know, is what you all think of this method
>> and how secure is it to run the username and passord in the file, if not,
>> what other options do I have?
> 
> Seems OK if you're not happy with hot backups. The password is not very
> safe though, unless it's under root. Perhaps you could make a user with
> a bizarre user name & no password & minimum rights, just for this op.
> It's debatable how secure it would be.

That's what I do, bare user with bare privs, but the user has user as pass,
why would I want to not have a password, what's the advantage here?

My thought is that with only a user, one is 50% there to guessing?  Granted
they can only SELECT, but at the same time, they would be able to see all
data?
> 
>> 
>> Second question, when I do a dump out of phpmyadmin, I get 1 line at a time
>> insert into statements, when they come from my script, I get one insert
>> concatenated with the rest.  They both work, so aside from one file being
>> larger than the other, what are the pros and cons?
> 
> The 1line at a time file would be more easily editable.

How do you tell mysqldump to export as one line at a time?

Can you explain hotcopy?  Does this just mean cp -R path_to_mysql/data ?  I
thought if data was being written this would be bad?



-- 
-------------------------------------------------------------
Scott Haneda                                Tel: 415.898.2602
http://www.newgeo.com                       Fax: 313.557.5052
[EMAIL PROTECTED]                            Novato, CA U.S.A.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to