Uploading Old Data to a New MySQL Database
The following command-line procedure makes a database in MySQL (or MariaDB) and populates it with content from a backup file.
==========
user@host: $ mysql -u root -p -h localhost
mysql> CREATE DATABASE dbname;
mysql> USE dbname;
mysql> SELECT database();
/* Checks if the intended database is the one being used. */
mysql> SOURCE dirname/filename;
/* Location of the backup file */
mysql> SHOW tables;
/* Verifies if the tables uploaded are from the backup file. */
mysql> GRANT ALL ON dbname.* TO 'username'@'localhost' IDENTIFIED BY 'password';
mysql> QUIT;
==========
Comments
Post a Comment