Re: Create new db in a specified folder
am 22.03.2006 15:55:32 von Bill Karwin
"JirkaJ" wrote in message
news:1143035375.958644.261980@z34g2000cwc.googlegroups.com.. .
> is it possible(and how?) to make a new database in a specified folder -
> i.e. /home/me/mysqldb? or how may i install mysql on debian to use this
> folder for data files?
All MySQL databases are created relative to the datadir.
You may be able to fool MySQL by using a symbolic link. The link exists
under the MySQL datadir, and points to the physical directory
/home/me/mysqldb/.
See http://dev.mysql.com/doc/refman/5.0/en/symbolic-links-to-dat abases.html
Note that this works for MyISAM tables, but not necessarily for InnoDB. By
default, all InnoDB data and indexes for all databases in a single file:
/ibdata1. If you use the InnoDB per-table tablespaces, you may be
able to achieve something similar. See
http://dev.mysql.com/doc/refman/5.0/en/multiple-tablespaces. html if you need
to do this.
Regards,
Bill K.
Re: Create new db in a specified folder
am 23.03.2006 08:01:14 von Heikki Tuuri
Hi!
"Bill Karwin" kirjoitti
viestissä:dvroh20afv@enews1.newsguy.com...
> "JirkaJ" wrote in message
> news:1143035375.958644.261980@z34g2000cwc.googlegroups.com.. .
>> is it possible(and how?) to make a new database in a specified folder -
>> i.e. /home/me/mysqldb? or how may i install mysql on debian to use this
>> folder for data files?
>
> All MySQL databases are created relative to the datadir.
>
> You may be able to fool MySQL by using a symbolic link. The link exists
> under the MySQL datadir, and points to the physical directory
> /home/me/mysqldb/.
> See
> http://dev.mysql.com/doc/refman/5.0/en/symbolic-links-to-dat abases.html
>
> Note that this works for MyISAM tables, but not necessarily for InnoDB.
> By default, all InnoDB data and indexes for all databases in a single
> file: /ibdata1. If you use the InnoDB per-table tablespaces, you
> may be able to achieve something similar. See
> http://dev.mysql.com/doc/refman/5.0/en/multiple-tablespaces. html if you
> need to do this.
yes, if you use innodb_file_per_table and symlink a database directory, that
will put also InnoDB tables to the symlinked location.
> Regards,
> Bill K.
Best regards,
Heikki
Oracle Corp./Innobase Oy
InnoDB - transactions, row level locking, and foreign keys for MySQL
InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM
tables
http://www.innodb.com/order.php