MySQL Console
Создать резервную копию БД:
mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
Применить резервную копию:
mysql -u root -p[root_password] [database_name] < dumpfilename.sql
Создать БД:
mysql -u <username> -p<password>
create database <databasename>;
Дать права пользователю на доступ к базе:
grant all on <databasename>.* to <username>@localhost identified by ‘<password>’;
flush privileges;
Загрузить дамп базы данных, после создания БД:
use <databasename>;
source <filename.sql>
Zip a Folder in Linux
I keep forgetting the command to zip a folder in Linux (Red Hat Enterprise Linux 4). And I have even got all files in the folder got zipped individually when I typed the command wrongly, which looked funny to me. The correct command, to remind myself:
zip -9 -r <zip file> <folder name>
To zip a single file:
zip -9 <zip file> <filename>
Use "-9" for best compression. The compressed file works fine with Windows XP compression tool.