MySQL Admin

By Sumitha Mani ·

I have mysql server 5.1 and I have 5 databases in it. For now, all the data in these databases are stored in one file 'ibdata1'. I want to store the data in separate files in the name of the respective database. for example, I want to store the data from DB1 in a file named 'db1' and for DB2 in a file named 'db2'. Please tell me how to change the 'my.ini' file according to this.


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

It doesn't work that way

by oldbaritone In reply to MySQL Admin

If your data is already all in one file, you can't just change the INI file to make the data separate.

You'll need to import/export the data into the new database files. You will end up with two copies of the data, then you will be able to delete the old file after you are done. I'm guessing that you mean you have many tables in one database file and you wish to separate them.

Of course, you will need to shut down the entire database and open it exclusively, so that users are not making changes while you are performing the export/import process. Then your applications must be changed to refer to the data using the new database name and table name.

Collapse -

Question posed more clearly! Please Help

by Sumitha Mani In reply to It doesn't work that way

Thanks for the response! I am a newbie to MySQL. When I connect to mysql using toad, I have a list of databases(eg- db1, db2,db3) on the object browser. For now, whatever changes I make in any of the databases, it is saved in the data directory in a file called - ibdata1. I want to save changes in db1 to a file in datadir/db1/db1table.MYD. Similarly, changes in db2 to be saved in datadir/db2/db2table1.MYD.
Please Help!

Related Discussions

Related Forums