473,513 Members | 3,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple Data Folders

Hi,

I am currently running out of space on one of my database servers. Is
it possible to move the relevant files for tables onto another drive
and instuct MySql to use both folders for it's data?

So basically can you have mulitple data folders setup and if so how is
this configured?

On another note I could delete some of the older data but the database
does not seem to reduce in size after my delete queries. How do I go
about truncating the database to free this space physically?

Kind Regards,
Mark
Jul 23 '05 #1
1 3212
Mark Everett wrote:
I am currently running out of space on one of my database servers. Is
it possible to move the relevant files for tables onto another drive
and instuct MySql to use both folders for it's data?

So basically can you have mulitple data folders setup and if so how is
this configured?
I've never found a way to have one mysql instance use multiple data
folders. You can specify only one datadir to the mysqld server, either
by command-line option or an entry in my.cnf.

However, you can use symbolic links to cause the actual storage for a
database or a table to be stored on another filesystem. See
http://dev.mysql.com/doc/mysql/en/symbolic-links.html
On another note I could delete some of the older data but the database
does not seem to reduce in size after my delete queries. How do I go
about truncating the database to free this space physically?


See http://dev.mysql.com/doc/mysql/en/in...agmenting.html

This page is specific to InnoDB, but I assume some of the issues are
common to MyISAM tables too.

Suppose you have a table that is stored in a file 2 gigabytes in size,
and you delete some records that happen to be stored near the beginning
of the file.

Should the mysql engine copy content from the remainder of the file to
close the gap left by the deletes? No, that could take many minutes to
resolve a simple delete operation.

Instead, the space left by the deleted rows is marked as available, and
the next time you insert data, the space could be re-used (if the new
data fit in that gap).

One way to re-pack a table is to dump it out with mysqldump, drop the
table in your database, and then re-load from the dumped data. You can
do this one table at a time if necessary. (you might want to try some
experiments with a small test database to make sure you are comfortable
with these steps.)

If you use InnoDB, you can repack the table with a dummy alter table:
ALTER TABLE tbl_name TYPE=InnoDB;

Regards,
Bill K.
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1770
by: Tank | last post by:
I have had this post up here when i was trying to figure out how to make leading zeros and have been able to fudge that to work. I am now have trouble getting the loop that makes the folders to start fresh after the .jpg section of the move images code. this will be essential to make the whole thing work. Please help. Even if you just...
4
10850
by: Ken Madden | last post by:
I want to create multiple fileSystemWatchers in a Windows Service to constantly watch multiple folders for file creations and then execute certain code based on these actions. The problem is that these directories are not part of the same directory so I cannot use the subfolder flag. The number of folders also has to be dynamic so I cannot...
0
1656
by: Jaco Karsten | last post by:
Hi I am desperately looking for a way to select multiple folders from an explorer type TreeView like the one used with the Windows backup utility. I would like to offer the user the ability to recursively select folders if he whishes to do so. The dialog inside shell32.dll called FolderBrowser only lets you select 1 folder. I want to...
2
2196
by: Greg W. | last post by:
In our setup project, we have the standard web application folder, but we also have 4 web custom folders (virtual directories) that are created at the same level as the web application folder (i.e. not subdirectories). The setup works fine as long as the user leaves the default setting of port 80. If they choose something different, the...
6
4847
by: Ludvig | last post by:
I have various domains using the same application/assembly They differ in contents and design, based on a "site id", and get its information from an SQL server. Now I have to deploy the different "sites" to individual folders on the server, and set up the domains on IIS to point to these folders. If I do changes in the application, I have...
9
2757
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and wizards. But, I have found that trying to do something "outside the norm" adds a rather large level of complexity and/or data replication. Background I...
0
3107
by: BillE | last post by:
I am using Visual Studio 2005 to create a web site which includes reports. The web site has several sub-folders. When working with reports I can't get the website data sources (classes and datasets in App_Code folders throughout the project) to behave consistently. Sometimes data source are displayed, sometimes not. Sometimes I can...
1
5825
by: toramadevi | last post by:
Hi ALL, I 'm using DevC++ for writing a C source code to create multiple files and folders under a directory.With the help of mkdir command i am able to get a bunch of 40 folders in the current working directory.I have given here my code. int main() { char folderNames; int i,fptr; mode_t dir_mode = S_IRWXU;
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7563
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7543
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5703
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4757
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3252
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.