It can be advantageous to move the directory on the supervisor which contains the SQL databases from the root volume or C: drive to a filesystem on a separate physical disk that is dedicated to the SQL databases.  This should be a separate physical disk, not just another partition on the same disk as other partitions, otherwise you'll get almost no benefit.

    Linux

    1. Be logged into the Supervisor as the root user
    2. Stop the Supervisor service: 
      1. /etc/init.d/supervisor stop
    3. Stop the mysql server: 
      1. /etc/init.d/mysqld stop
    4. Copy the current datadir over to the new location ensuring that you preserve ownership and permissions
      1. cp -rP /var/lib/mysql /newpath/mysql
    5. Rename the current datadir so that it won't be found by mistake, but leave it in place so you have a fallback plan: 
      1. mv /varl/lib/mysql /var/lib/mysql.MOVED
    6. Edit the /etc/my.cnf, copy the datadir line, comment out the original as a backup (part 2 of the fallback plan), and edit the uncommented line to point to the new location
    7. Start the mysql server: 
      1. /etc/init.d/mysqld start
    8. Check that the new datadir is the one being used:
      1. mysql -u root -e "SHOW variables like 'datadir'"
    +---------------+-----------------------------------------------+
    | Variable_name | Value                                         |
    +---------------+-----------------------------------------------+
    | datadir       | /usr/local/MySQL-5.1.44-MACOSX-Universal/var/ |
    +---------------+-----------------------------------------------+
    

    If it looks good, start the Supervisor service: 

    /etc/init.d/supervisor start

    Windows

    1. stop the qubesupervisor service
    2. stop the pfxmysql service
    3. move the C:\Program Files\pfx\qube\mysql\data directory to the new directory, e.g., D:\qube\data
    4. edit C:\Program Files\pfq\qube\mysql\my.cnf, change the datadir value to point to D:\qube\data
    5. start the pfxmysql service
    6. test that the mysql server sees the databases in their new location by running: mysql -u root -e "SHOW DATABASES" It should return a list of databases which include some with the word "qube" in the name.
    7. start the qubesupervisor service

     

    • No labels