I have a local installation of MariaDB on Windows XP.
I created an empty db_y database, which I wanted to populate with db_x database db_x , which I exported as a dump file from a MySQL instance (with HeidiSQL).
When I imported the dump db_x.sql file into the MariaDB instance:
c:\ > mysql -u root -h localhost -p db_y < "X:/archive/db_x.sql"
I got the following:
- MariaDB-inst +db_x +db_y
db_y remains empty and db_x from the dump file was added (db_x is the name of the database of the source database that I exported).
What do I need to do to get the right database name?
I thought I could change the database name in the db_x.sql file, but I did not want to open such a large file.
Can I change the import command above to change the database name?
I am also interested in this solution:
CREATE DATABASE y FROM DATABASE x
Is this possible?
On the net, I found a RENAME DATABASE solution that was not recommended, and ALTER DATABASE db_x UPGRADE DATA DIRECTORY NAME but sincerely, I chose to create a new database with a new name. Thanks for any help.
database mysql heidisql
giordano
source share