how to backup mysql database in store procedure or event? - mysql

Is there a way to backup database using event scheduler in mysql?
i want to run this event in phpmyadmin,
now i have a code for backing up a single table, but i want it to be a single file of database.. is that posible?

Related

MySQL compare newly created dump file to database

I have this task in my work to create a MySQL dump file and i have to review the file before restoring it from a different server.
My problem is how to compare my created dump file to the database where i get it from to make sure that all tables or function and stored proc are included in the dump file.
Is there a way to do it because currently i'm manually reviewing the dump file per table name function and stored proc which is very time consuming.

For my database within MySQL Workbench, is there a way to obtain the script that would have been needed to create the current state of the database?

I've run a script before to create a database within MySQL Workbench; however, this time I have manually created the tables, columns, constraints etc...
Now that my database is setup, is there a way to obtain or generate the script that would have been required to create the current state of my database?
This is called a database dump. Open a connection to your server in Workbench. Then switch to the Administration tab. Click the Data Export entry to open the SQL dump section.
Select all the schemas you want to export, specify an output path and click the Start Export button.
Note: this will not export users, only schemas and their data.

Run Sql Dump through stored procedure in mysql

Can we run the SQL dump command through a stored procedure/Trigger. I have to create a database on fly when certain events happen in the table.
I have achieved it on mysql command prompt or by workbench, however need a way to do it through procedure or trigger.

How to schedule a job in mysql workbench

In MySql DB, How to populate a specific table with the data of an excel file every day.
I want this job to run every morning at 8.00am.
How can i do this?
You cannot do that with MySQL Workbench. You need some external timer service (cron job in linux/mac, scheduler service in Win) to run a batch file to make the import.

Run MySql script as batch file on Windows Server

I have about 3 or so weekly generated .CSV files that are automatically placed in a particular directory on my MySQL box.
What I would like to do is run some sort of automated script that opens the MySQL command line and executes a query to delete all records in the corresponding table and LOAD DATA INFILE from the CSV's.
Being that I'm on Windows I cannot do a chronjob, though I was thinking I could do some sort of batch script and run it as a Scheduled Task.
Any idea how I would go about doing this?
Depending on your MySQL version you could use CREATE EVENT to schedule some database statements, check:
http://dev.mysql.com/doc/refman/5.1/en/create-event.html