Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Nov 2008
    Posts
    174

    Default Possible to set where WHM keeps MySQL DBs?

    If I was to install WHM/Cpanel on a new dedicated box, which has Raid 1 OS and Raid 5 data areas, I would probably want to put the MySQL databases on the Raid 1 storage, and the rest of the user account's stuff on the Raid 5 storage. Is there a way to tell WHM where to setup MySQL DBs, as I have never seen this in any config screens.

    I have yet to delve into the command line underworld to see if how this can be done, but wanted to check there wasn't a simple way first!

  2. #2
    Member Data 1's Avatar
    Join Date
    May 2008
    Posts
    104

    Default

    IMO it's easier to let it put it where it wants then move it.

    If you already know how to move things ok if not I have a tutorial I wrote for myself.

    If you partition yourself you can avoid this but some hosts (if you lease dedicated servers) just "do what they want". This puts MySQL in a very small /var partition and it must be moved if you host any sizable databases.

  3. #3
    Member
    Join Date
    Nov 2008
    Posts
    174

    Default

    I'm quite happy to move it after an initial install of the OS and Cpanel.

    If you could share your tutorial, I'd be grateful. I'll have to read up this week on how to find where MySQL is installed on my existing Cpanel machine. It's just one area I've not yet had to get too involved in.

  4. #4
    Member Data 1's Avatar
    Join Date
    May 2008
    Posts
    104

    Default

    Quick and simple. I have no idea of your experience level but fooling around with root SSH can render the server useless with a couple typo's. Only do this if you are confident please.

    This is for servers with /var in it's own partition, usually too small. What it does is moves the entire MySQL directory inside the /home directory (traditionally the largest partition) and creates a symlink from the original location to the new one.

    Log in SSH as root. Again be careful. Run the first 3 commands, do what it says in line 4 then run line 5.

    1. mkdir /home/mysql

    2. chown mysql /home/mysql

    3. mv /var/lib/mysql/* /home/mysql

    4. delete empty original mysql directory

    5. ln -s /home/mysql /var/lib/mysql


    This was done on 3 live servers with multiple accounts. All accounts kept working flawlessly as well as the backups. All 3 servers were Centos 5 with cpanel.

    Jim

  5. #5
    Member
    Join Date
    Nov 2008
    Posts
    174

    Default

    Nice... I've since found my /var is actually just a directory off my home partition so I have no space restrictions. It turns out the dedi I was looking at has a far faster home partition than the mass Raid 5 storage (it's hanging off a large SAN which is not - in practice - as good as the drives built into the blade.

    Using a link is a good idea - saves a lot of faffing about with reconfiguring mysql I guess, and if you say it's working well in a production environment, then it must be an appropriate method.

    Cheers

Similar Threads & Tags
Similar threads

  1. Terminate an Account while leaving MySQL DBs intact (shared MySQL svr)
    By mephisto in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 10-26-2010, 12:16 PM
  2. Grabbing mysql dbs........mysql: not found
    By janez_kranjski in forum New User Questions
    Replies: 1
    Last Post: 03-26-2010, 08:19 PM
  3. Remove old mysql dbs
    By fleksi in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-10-2006, 10:38 PM
  4. mysql dbs not showing in account?
    By aykfounder in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-24-2006, 06:40 PM
  5. Backup and restore MySQL DBs
    By bmcclure in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 05-12-2004, 06:24 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube