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 usage

Discussion in 'Database Discussions' started by petfut, Feb 28, 2005.

  1. petfut

    petfut Well-Known Member

    Joined:
    Feb 14, 2005
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    156
    How can I limit the MySQL usage of a website?
    I want it to be included for the webspace I have given to this client.

    It looks now that cPanel doesn't count together the SQL and hd space usage.
    It shows too much amount to be available.
     
  2. petfut

    petfut Well-Known Member

    Joined:
    Feb 14, 2005
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    156
    . . bump . .
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,472
    Likes Received:
    20
    Trophy Points:
    463
    Location:
    Go on, have a guess
    You can't because the mysql files are not owned by the account username.
     
  4. Creazioni

    Creazioni Well-Known Member

    Joined:
    Jan 5, 2003
    Messages:
    133
    Likes Received:
    0
    Trophy Points:
    166
    right...
    BAD THING!!!

    into cpanel
    mysql usage 8mb
    usage domina 10mb

    why CPANEL don't work to solution?
    mysql+domain
     
  5. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    166
    I think this pretty much explains why Cpanel can't create a solution. As the MySQL files are not owned by the account username, it is not possible to tell who owns each MySQL file and therefore if you can't tell who owns the file you can't tell whose disk quota you should associate it with.

    The shortened answer being it can't be feasibly achieved.
     
  6. petfut

    petfut Well-Known Member

    Joined:
    Feb 14, 2005
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    156
    is there any kind of easy solution how to monitor this, perhaps a cron script that would count them together and alert if it goes over.. or what?
     
  7. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    166
    As the MySQL files don't belong to any cpanel account (they're probably owned by 'mysql') it would never be possible to determine with 100% accuracy whose quota each file's content should count towards.

    MySQL database content should be stored in /var/lib/mysql (at least it is for me), with each database's content within /var/lib/mysql/databasename/

    Now 'databasename' should probably be cpanelaccountusername_something if the database was created through cpanel. However this is assuming that all users create databases through cpanel - this may not always be the case.

    You can see that even trying to determine which account is responsible for the content of which files is a little flaky at best.

    Therefore I doubt that there is any method accurate enough to be relied upon - too many ifs and maybes and assumptions are needed. My thinking is that if there was an easy, reliable and accurate way of doing this the feature would be in Cpanel already.
     
  8. petfut

    petfut Well-Known Member

    Joined:
    Feb 14, 2005
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    156
    Ok, is there then an easy way to print out databases and database usage?
     
  9. Brio

    Brio Member

    Joined:
    Jul 9, 2003
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    151
    SSH in and run

    /scripts/updatemysqlquota

    and it will list in within your users cPanel under MySQL usage, and it will be included within total usage.
     
  10. futuron

    futuron Active Member

    Joined:
    Jul 26, 2004
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    156
    Umm.. no it won't?
     
  11. Brio

    Brio Member

    Joined:
    Jul 9, 2003
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    151
    A reply of more than "um.. no it won't" really doesn't help anyone. Why won't it?

    When you run that script it will chown the database files for each user to their own username under mysql.

    They will then show up when you log into cPanel under the "sql usage" header, and it will be part of the total.

    e.g.

    FTP space used: 10mb
    SQL Usage: 5mb
    Total usage: 15mb
     
Loading...

Share This Page