List:General Discussion« Previous MessageNext Message »
From:gerald_clark Date:May 28 2004 3:00pm
Subject:Re: location of created database
View as plain text  

Bono, Saroj AA R62 wrote:

> 
>When I created a database (directly in mysql) from some random dir where
>I started mysql, I found that it got created in the /var/lib/mysql dir. 
>I ran mysql from a dir where my C++ program is. I wanted to create a
>database using mysql_query so I did mysql_query( &mysql, "CREATE
>DATABASE IF NOT EXISTS abc"). THis didnt create anything. If it did
>would it be created in the /var/lib location ?I want to create it in my
>local dir (when I do get my syntax to work!). How do I tell mysql to
>make the database in some specific location? 
>Thanks.
>
>  
>
You don't.  All mysql databases for a specific server must appear in its 
database directory.
You can, however stop the server, move the database and create a 
symbolic link in /var/lib/mysql
that points to it.
Why do you want to do this?  It sounds like a potential administration 
nightmare.

Thread
location of created databaseSaroj AA R62 Bono28 May
  • Re: location of created databasegerald_clark28 May
  • Re: location of created databaseLou Olsten28 May