mysqldump in MySQL database
Hello sir,
I am working running with Linux operating system (RHEL) and I am from developer track for oracle database.I am also interested in MySQL database and need to learn some administrative operation on MySQL database,but I got the mysqldump file in book but there is no any more description about this file in the book.
So please tell me something about this file.
mysqldump in MySQL database
mysqldump in MySQL database
The mysqldump file is used to manage the internal process during the backup of mysql database.
Code:
mysqldump --opt mydatabase > sql.dump
The --opt parameter indicates during backing up our database should theoretically give us the fastest needed dump for reading back into MySQL server.The meaning of the "opt" is optimize.
Internal effect of taking backup
Internal effect of taking backup :
when you execute the command to take the backup of the database,there are so many processes which and executions are made in the background.
It's a sample of the sql.dump file which was generated when I backed up the same database with the –-opt parameter-
Code:
#
# Table structure for table 'tbl_contactemails'
#
DROP TABLE IF EXISTS tbl_contactemails;
CREATE TABLE tbl_contactemails (
pk_ceId int(11) NOT NULL auto_increment,
ceEmail varchar(250) NOT NULL default '',
ceType int(11) default NULL,
PRIMARY KEY (pk_ceId),
UNIQUE KEY id (pk_ceId)
) TYPE=MyISAM;
#
# Dumping data for table 'tbl_contactemails'
#
LOCK TABLES tbl_contactemails WRITE;
INSERT INTO tbl_contactemails VALUES (18,'[email protected]',1),(17,'[email protected]',1),(16,'[email protected]',1);
UNLOCK TABLES;
These are the procedures which internally happens with the dump file.
Backup of database using mysqldump
Backup of database using mysqldump
If you need to take the backup of database using mysqldump file then you have to be aware about the command and related arguments which would be passed with the mysqldump file.
The commad to take the backup would be as follows-
Code:
mysqldump -udbusername -pdbpassword dbname > mybackup.sql