The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL Setup, 1 or many?

Discussion in 'General Discussion' started by theMikeroy, Nov 18, 2006.

  1. theMikeroy

    theMikeroy Member

    Joined:
    Oct 6, 2006
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Just curious...

    With regard to how cPanel handles all of the sub-client's mysql databases, does cPanel itself use a single MySQL instance, and run all the db's from that, or does each user initiate their own mysql processes?

    I'm curious, becase i was looking to build a multi-computer cpanel hosting setup where the mysql db's were on a seperate host (the computer's would be side-by-side, mind you), and i want to know how i should properly handle the backups for the DB's.

    Any info is appreciated!
    Thanks!
     
  2. eth00

    eth00 Well-Known Member
    PartnerNOC

    Joined:
    Mar 30, 2003
    Messages:
    723
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    NC
    cPanel Access Level:
    Root Administrator
    It is just a standard copy of mysql, you can even install a copy from mysql.org. It does not do any sort of fancy chrooting or other things that might make your life difficult for what you are trying.
     
  3. theMikeroy

    theMikeroy Member

    Joined:
    Oct 6, 2006
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Right, it's just mysql.

    Is it 1 instance of it running, with every client hosted on the machine using the same process, or does each domain have their own instance of MySQL running?

    Backing it up is trivial, i just need to know am i backing up 1 database with a dozen users, or a dozen users with a dozen databases?

    I know that cPanel automatically uses a prefix for domains to identify the user associated with it (user_mysqldb, user_mysqldbuser, etc...), but again, it is 1 database, or many?
     
  4. eth00

    eth00 Well-Known Member
    PartnerNOC

    Joined:
    Mar 30, 2003
    Messages:
    723
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    NC
    cPanel Access Level:
    Root Administrator
    It is just a standard install of mysql with no chrooting - it all runs from the mysqld process.

    If you take a look in phpmyadmin or /var/lib/mysql it is apparent that each database is separate. If a user has 3 databases created all 3 will be regular databases on mysql.

    You are backing up dozens of users and even more dozens of databases.
     
  5. freedman

    freedman Well-Known Member

    Joined:
    Feb 13, 2005
    Messages:
    312
    Likes Received:
    1
    Trophy Points:
    18
    the user access information is in one place and run from one instance of mysqld
    > ps -eaf | grep mysql
    will show 1 instance with a child.

    each user, will have their own database(s), but accessed through the same mysql instance.

    You want them to access databases on a remote machine: db.USERDOMAIN.XXX or db.hostingcompany.net -- you'll have to do some manual work, I believe.
    The issue is, cpanel just assumes you only have one machine... when the user creates a database through their user control panel, it runs a cpanel script which creates the database and adds the user id to the local mysql on this machine.

    So, if you're going to run the DB's from a separate machine, then you'll have to replace this functionality within cpanel and write your own script which adds the users DB/access info to your remote database.

    you can browse around for how to add custom controls to the user cpanel.
    if you relaly want to have your users using DB's on remote machines, it's probably worth doing this development --you only have to write this code once.--it's possible if you search around, you'll find someones done this, but I havn't searched so I dont know for sure.

    hope that answers your question.
     
Loading...

Share This Page