SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict TegSkywalker's Avatar
    Join Date
    Nov 2001
    Location
    USA
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Help having MySQL save data to secondary drive

    What's up guys? I am currently in the process of setting up a MySQL database and need to store the info on a secondary hard drive instead of the main one.

    This may sound like a silly question, but where can I change it in my config files (im assuming mysql_config) to properly have it save to the secondary drive instead of the first? I think the data by default is stored in the /data/ folder and if my secondary drive is name like "web2" do i have to edit the config files to point to like web2:/mysqldata/ if I wanted stuff stored in that folder?

    Any help would be great

  2. #2
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you don't use the drive name, but the letter. it's the datadir option in your my.ini (C:\Windows) or my.cnf (C:\), whichever you have.

    say you have MySQL installed in C:\mysql now. the datadir by default is C:\mysql\data. i've changed mine to this:

    Code:
    datadir=F:/MySQL/data
    just point yours wherever you want (use forwards slashes), and restart MySQL. if you have databases in the current location, just stop MySQL and move the folder to the new location. start MySQL again, and everything will work as before.
    - Matt ** Ignore old signature for now... **
    Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
    "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

  3. #3
    SitePoint Addict TegSkywalker's Avatar
    Join Date
    Nov 2001
    Location
    USA
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Eep! I should have specified that this WASNT a Windows server, when it was actually a FreeBSD based server called Mac OSX Server.

    Got any tips for a UNIX user?

  4. #4
    Making a better wheel silver trophy DR_LaRRY_PEpPeR's Avatar
    Join Date
    Jul 2001
    Location
    Missouri
    Posts
    3,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    tips? you mean on how to move the data directory? in your other thread it looks like you were able to get it moved, so that's good. i have NO idea where the my.cnf file would be on OSX. i just know that it's usually in /etc on Linux.
    Last edited by DR_LaRRY_PEpPeR; Jan 22, 2002 at 15:08.

  5. #5
    SitePoint Addict TegSkywalker's Avatar
    Join Date
    Nov 2001
    Location
    USA
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah I figured it out. Created a my.cnf file in /etc/ and seemed to do the justice


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •