MySQL : How to restore single table from full database backup in MySQL Server

preview_player
Показать описание
MySQL : How to restore single table from full database backup in MySQL Server

1) Create a Backup user
2) Create a password less connection
3) Create a script to backup testdb database
4) restore testdb database on same server

Step 1) Create a Bcakup user

GRANT SELECT, SHOW VIEW, RELOAD, REPLICATION CLIENT, EVENT, TRIGGER ON *.* TO 'mysqlbackup'@'localhost';
GRANT LOCK TABLES ON *.* TO 'mysqlbackup'@'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'mysqlbackup'@'localhost';

Step 2) Create a password less connection

mysql_config_editor set --login-path=emultiskills_MYSQL_mysqlbackup --host=localhost --user=mysqlbackup --password

-- It prompts for the password. 

mysql_config_editor print --all

mysql --login-path=emultiskills_MYSQL_mysqlbackup

Step 3 ) Backup database password exposed/masked

Backup database password masked

show databases;
use testdb;
show tables;

Step 4) restore one table of testdb on same server

Syntax

Рекомендации по теме
Комментарии
Автор

two databases with same table name it is not working

vikrambalye