List:General Discussion« Previous MessageNext Message »
From:Claudio Nanni Date:September 18 2009 10:54am
Subject:R: Re: Mysql dynamic database location
View as plain text  
Nice!
Bit are you sure that database is nowhere in the information schema?
And/or innodb tablespace info
Claudio

Il giorno 18 set, 2009 11:30 m., "Johan De Meersman" <vegivamp@stripped> ha
scritto:

You can do that at runtime no problem, you just need to do OS calls for it.

root@soulcake-duck:/var/lib/mysql# *mysqlshow*
+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| mysql              |
+--------------------+
root@soulcake-duck:/var/lib/mysql# *mkdir /tmp/remotedb*
root@soulcake-duck:/var/lib/mysql# *chown mysql:mysql /tmp/remotedb*
root@soulcake-duck:/var/lib/mysql# *ln -s /tmp/remotedb/*
root@soulcake-duck:/var/lib/mysql# *mysqlshow*
+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| mysql              |
| remotedb           |
+--------------------+
root@soulcake-duck:/var/lib/mysql# *mysql remotedb*
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 39
Server version: 5.0.67-0ubuntu6 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> *create table a (a int);*
Query OK, 0 rows affected (0.00 sec)

mysql> *show tables;*
+--------------------+
| Tables_in_remotedb |
+--------------------+
| a                  |
+--------------------+
1 row in set (0.00 sec)

mysql> Bye
root@soulcake-duck:/var/lib/mysql#




On Fri, Sep 18, 2009 at 10:54 AM, Claudio Nanni <claudio.nanni@stripped>
wrote:
> As far as I know, you can't,
> you can do it with symbolic linking but not at run time.
> So if you have a clue you can (pre)build empty databases using symbolic
> linking and switching to the right one at run time.
>
>
> Cheers
>
> Claudio Nanni
>
>
> 2009/9/18 Manasi Save <manasi.save@stripped>
>
>> Hi All,
>>
>> Is it possible to change or create any database on a specific location.
>> I want to specify a db path at runtime.
>>
>> Thanks in advance.
>> --
>> Regards,
>> Manasi Save
>> Artificial Machines Pvt Ltd.
>>
>>
>>
>>
>> --
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe:
>> http://lists.mysql.com/mysql?unsub=1
>>
>>
>
>
> --
> Claudio
>



-- 
That which does not kill you was simply not permitted to do so for the
purposes of the plot.

Thread
R: Re: Mysql dynamic database locationClaudio Nanni18 Sep
  • Re: R: Re: Mysql dynamic database locationJohan De Meersman18 Sep