Archive for the ‘MYSQL’ Category

Mysql Dump Timer-MySQL database

Thursday, October 15th, 2009

Mysqldump program is used to dump the contents of a MySQL database and allow the transfer of a MySQL database and MySQL tables between different MySQL servers. The SQL statements can be redirected to a file though you should be sure that there is no activity going on while you do. Firewalls will not block the access to the MySQL database,  A small PHP script which has to be copied to the webserver encapsulates and encrypts the access to the MySQL database.

The mysqldump program supports the following options;

-#, –debug=[options] Output debug information to log. Generally ‘d:t:o,filename`. See Appendix C for further details.
-?, –help Display usage information and exit.
-c, –compleat-insert Generate complete insert statements. (Don’t exclude values that conform to the column default.)
-h, –host=[hostname] Connect to hostname.
-d, –no-data Export only schema information. (Exclude data.)
-t, –no-create-info Export only data, exclude table creation information. (The opposite of -d.)
-p, –password=[password] The password to use when connecting to the web server. Note there can be no space between the -p and the password.
-q, –quick Don’t buffer query results, dump directly to STDOUT.
-u, –user=[username] Username for login. mysqldump will assume you wish to use your current login name if this option is excluded from the command line.
-v, –verbose Print verbose information about the various execution stages of mysqldump.
-P, –port=[port] The port to use when connecting to
-V, –version Output mysqldump version information and exit.

It also enable you to pipe the output of mysqldump to the MySQL client program to replicate a database but you should make sure-no updates are taking place while you’re doing this.

EXAMPLE:
mysqladmin create foo
mysqldump mysql | mysql foo