Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I InnoDB multiple tablespaces, on multiple disks?

Status
Not open for further replies.

Tore

Technical User
May 18, 2001
29
NO
Hi.

I want to use multiple tablespaces with InnoDB tables.

And I also want to spread my InnoDB tables on two separate disks.

I also want to control which disk each of the InnoDB tables are placed.

Is this possible?

How do I do it?

Example config please
 
You might try the innodb_file_per_table option and symlink the files to were you want them.
 
Can you show me an example on how to use this symlink stuff.

And, when will the symlinks be broken?

I need it to work on both windows and linux.


One place in the manual MySql says that it works as for MyIsam tables except that InnoDB uses one file for each table for both indexes and data.

The 'CREATE TABLE' has a table option
"DATA DIRECTORY = 'absolute path to directory'".

Is this supposed to work for InnoDB with multiple tablespaces?
From their manual it says only for MyISAM tables....
but one could hope ......

 
To create a symbolic link use "ln -s"

I don't do windows, so I can't help there.
 
Could you be more specific:

How does it look like in the mysql config file?

Could you show an example using two tables and placing those two tables on different disks.


It has to work with InnoDB tables!!!

 
Create your innodb table after setting the innodb_file_per_table setting (read the mysql manual if you don't know how).

After the table is created, shut the database down, then move the file to the disk you want it to live on. Then use "ls -s /new/path/to/file /path/where/mysql/expects/to/find/it" to create the symlink. Then restart the database.

Try it first to make sure it works.

 
Is there any pitfalls when using symlink and InnoDB tables with "multiple tablespaces"? (ref. previous thread).

What does not work when using symlinks and "multiple tablespaces" with InnoDB?

What will eventually cause the symlink to be broken?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top