For backup MySQL MyISAM database, I'm using:

mysqldump -u root -pthepass --lock-tables --add-locks --disable-keys --skip-extended-insert --quick $backupdb > /var/www/html/db2.sql

Even after long time using it, I still dont know what is the name of using nameofmychoice=anyname.

After typing backupdb=siteone I need to know how long it will kept in memory? If I running many lines of command which takes very long time, do I need to type backupdb=siteone again and again from time to time to regenerate the alias?

Is using this way really safe for almost anything? I'm worried of data loss since I'm dealing with database.


In your example, backupdb is called a variable. A shell variable will be there until you change it to a new value, or the shell exits (most likely because you type exit, or close the terminal). In your case, backupdb will be there for a long time, so you don't need to type that again and again.

My guess is that you are using the BASH shell because it's quite popular. If you want to find out more you can read the BASH programming intro.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.