visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Databases :: MySql :: put database in new file \ linux


By: toTo U.S.A.  Date: 13/06/2003 00:00:00  English  Points: 300 Status: Answered
Quality : Excellent
how can i know in wich actual file mysql stores the databases, and choose to put them in separated files to prevent a user to hog all the space.

thanks
By: monange Date: 13/06/2003 23:47:00 English  Type : Comment
every database corresponds to a folder in the mysql data folder. By default, that folder is in %mysqlhome%/data:
for example /usr/local/mysql/data
the database name corresponds to the subfolder of the above folder, and all the files in there should be considered to be part of the database.

CHeers
By: VGR Date: 14/06/2003 00:12:00 English  Type : Comment
to complement : your data is in %datadir/databasename/tablename.extension

where extension is {FRM, MYI, MYD}
By: toTo Date: 14/06/2003 00:41:00 English  Type : Comment
Thank you,
and if i have a special user that want too much room, how can i choose where to put his data while i leave the rest in the default directory ?
By: VGR Date: 14/06/2003 00:47:00 English  Type : Comment
huh, tough (albeit good) question
By: VGR Date: 14/06/2003 00:50:00 English  Type : Comment
I'm afraid there is only one datadir...
By: VGR Date: 14/06/2003 00:51:00 English  Type : Answer
only possibility : run a second instance of mysqld server and use the --datadir=path option to safe_mysqld.
By: toTo Date: 14/06/2003 01:03:00 English  Type : Comment
but i have to tell the user to use another port.

By: VGR Date: 14/06/2003 01:25:00 English  Type : Comment
hummmm yes
By: psadac Date: 14/06/2003 01:26:00 English  Type : Comment
as monange told you every database corresponds to a folder in the mysql data folder. so you have two options :
- buy another disk and mount it on /datadir/database directory. database size will be limited to disk size.
- use quotas to limit disk usage.
i think running another instance of mysql is not a good solution. i will use more memory and you will have 2 configuration files, backup jobs, accounts .... to manage

these options apply only to linux/unix os. if you run mysql on window$, ... switch to linux ;-)

By: VGR Date: 14/06/2003 01:43:00 English  Type : Comment
the problem with the solution which "is not a good solution" is that it's the only one answering the question (two different datadirs on same machine) :D

Do register to be able to answer

EContact
browser fav
page generated in 314.054010 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page