top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How can I take the backup of a MySQL table and restore it?

+2 votes
475 views
How can I take the backup of a MySQL table and restore it?
posted May 6, 2014 by Sachin Dahda

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Mysqldump is an effective tool to backup MySQL database. It creates a *.sql file with DROP table, CREATE table and INSERT into sql-statements of the source database. To restore the database, execute the *.sql file on destination database.
Using Mysqldump, you can backup a local database and restore it on a remote database at the same time, using a single command.

Backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql
Restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql

answer May 7, 2014 by Rahul Mahajan
Similar Questions
+2 votes

I have moderate level PHP programming skills. I am also interested in merging those skills inside of the WordPress app. With their advanced responsive design themes and many other functions it seems like a good idea. I have tried loading some PHP plug-ins in WP – but I don't seem to get them to do more than basics.

Can anybody help me on how I can get started working with PHP/MySQL inside of the WordPress app?

+3 votes

How to take backup of Database once in a day using MySql.

0 votes
for($i=0;$i<=feof($getdata);$i++)
{
if (filter_var($data[$i][1], FILTER_VALIDATE_EMAIL)){
echo $data[$i][1];
$email=$data[$i][1];
$conn = mysqli_connect($dbhost,$dbuser,$dbpass, $dbname);
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}
$sql ="INSERT INTO promo_user (uid,name,email) VALUES (,'', '$email')";
mysqli_query($sql,$conn);
mysqli_close($conn);

I am using the above code but there is something wrong with it,whenever i run the code the echo is working fine but the content does go into sql table

Please help

+5 votes

How can I insert the content of excel file into MySQL Table, any pointer?

...