Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3229346
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:48:00+00:00 2026-05-17T16:48:00+00:00

I have a mysql database with 4 different databases. 1 of the databases has

  • 0

I have a mysql database with 4 different databases. 1 of the databases has a lot of read/write activity that would benefit from being run on ramdisk. Due to the nature of the data layout and types of reads needed, memcached is not an effective option here. Therefore, I would like to run one of the databases in a ramdisk (data persistence is not an issue here).

The question: Is there anyway to set the data directory for just one table in a mysql database? I want 3 of the databases to have a data directory on my harddrive, and the other one pointed towards a directory in a ramdisk. If not, how could I install two instances of mysql on the same server (I am using Ubuntu).

Btw: I am aware of the MEMORY engine but that barely improve performance (doesn’t seem to truly be running in memory).

EDIT:

I accidentally asked to specify the data directory for a table. What I actually meant was to ask how to specify the data directory for a 1 out of 4 databases in a mysql installation. The post has been updated to reflect this correction.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:48:01+00:00Added an answer on May 17, 2026 at 4:48 pm

    For MyISAM tables, you can just provide a DATA DIRECTORY & INDEX DIRECTORY clause in your CREATE TABLE statement (if you partition your table, you’ll have to set it per partition I believe).

    $ mkdir /tmp/datadir
    $ sudo chown mysql:mysql /tmp/datadir/
    $ mysql
    mysql> use test;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Database changed
    mysql> create table otherlocation (id int) ENGINE=MyISAM, DATA DIRECTORY='/tmp/datadir', INDEX DIRECTORY='/tmp/datadir';
    
    Query OK, 0 rows affected (0.01 sec)
    mysql> Bye
    $ ls -lah /tmp/datadir/
    total 496K
    drwxr-xr-x  2 mysql mysql 4.0K Oct 18 00:57 .
    drwxrwxrwt 32 root  root  484K Oct 18 00:55 ..
    -rw-rw----  1 mysql mysql    0 Oct 18 00:57 otherlocation.MYD
    -rw-rw----  1 mysql mysql 1.0K Oct 18 00:57 otherlocation.MYI
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I have two mysql servers that have different jobs (holding different databases) but
I have a MySQL database of keywords that are presently mixed-case. However, I want
I have a mysql database which has grown to over 200 tables in it.
I have a MySQL database that I want to archive . What is the
I have a MySQL database behind a firewall which can only be accessed via
I have a MySQL database table with a couple thousand rows. The table is
I have a mysql database filled up and running on a Windows computer, is
I have a mysql database set as utf-8, and csv data set as utf-8,
I have a mysql database which as one of the fields contains a html
I have a MySql database with three tables I need to combine in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.