You are not logged in.

#1 2009-02-13 14:20:37

otti
Member
Registered: 2006-12-18
Posts: 64

Mysql and option datadir (not work as intended?)

Hi,

I want to use a different directory for storing data from tables. So I edited /etc/my.cnf:

...
datadir         = /mnt/extra/mysql_db
...
innodb_data_home_dir = /mnt/extra/mysql_db
...

(quoted only the things that I changed)

(I use InnoDb tables.)
The result is, that the "ibdata1"-file is stored in the new directory, but the database and table information are still stored in the default directory: /var/lib/mysql.

I thought that the option "datadir         = /mnt/extra/mysql_db" would take care of this...

Does anybody know how to store the database and tabel information in a different directory than the default?

Thanks.

Offline

#2 2009-02-13 15:06:52

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,221
Website

Re: Mysql and option datadir (not work as intended?)

Offline

#3 2009-02-13 15:51:43

otti
Member
Registered: 2006-12-18
Posts: 64

Re: Mysql and option datadir (not work as intended?)

The link describes basically what I did...

The problem is, when I create a new database (in mysql: create database newDb) the data (for the new database) is again stored in /var/lib/mysql.

Is there no way, to store data for new databases in the specified directory (in the datadir-variable)?

Last edited by otti (2009-02-13 15:52:20)

Offline

Board footer

Powered by FluxBB