Как вывести базу данных MySQL в определенную папку в Linux, используя скрипт Bash? - PullRequest
0 голосов
/ 20 октября 2018

Я хочу вывести свои таблицы базы данных в определенную папку несколько раз в файле, указанном в режиме реального времени и времени создания дампа.Как я могу сделать ?

1 Ответ

0 голосов
/ 20 октября 2018

 1. Write this script inside any file for e.g. Sky [file extension doesn't matter] and make this file as executable file


current_date_time="`date "+%Y-%m-%d%H:%M:%S"`";
cd /home/akashgudadhe/FunZone/
mysqldump -u [user_name] -p[password] [dbname] > `pwd`/"$current_date_time.sql"


2. Run using terminal

./Sky [<----any_of your file name that you preferred above]

It will save [newly_created_file] into specified directory automatically.
...