I have a MySQL database that contains almost 100 tables.
I want to set up N additional MySQL databases on the same server, each running on a different port. And I want each additional database to have the same schema/table structures as the original database.
I found this solution to be helpful except the last statement of it which is causing me the problem.
The last statement says to include "source database-schema.sql; " When i include that statement in my .sql file and run in MySQL command line, it reads an error WRT the path mentioned.
My .sql file looks like below.
DROP database IF EXISTS `university_copied1`;
create database university_copied1;
GRANT ALL PRIVILEGES
ON university_duplicate.*
TO 'root'@'localhost'
IDENTIFIED BY 'root'
WITH GRANT OPTION;
use university_copied1;
source C:\Users\xxx\Documents\Programs\Database\dump.sql;
I have modified the last statement with different variation but with no value.
I have tried the following:
- Enclose the path in ""
- Enclose the path in ''
- Enclose the path in ``
- Use double forward slash as below source C:\Users\xxx\Documents\Programs\Database\dump.sql;
Environment: MySQL 5.6 on windows 8.1
Note: Dump is successfully imported when executed on the MySQL command line. Problem is seen only when trying to execute it by including in a .sql file.
Kindly suggest for any solutions. Thanks in advance.