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.

Securing /tmp and Mysql problems

Discussion in 'General Discussion' started by bmcpanel, Jun 25, 2004.

  1. bmcpanel

    bmcpanel Well-Known Member

    Joined:
    Jun 1, 2002
    Messages:
    546
    Likes Received:
    0
    Trophy Points:
    16
    I have a customer who is complaining about mysql problems after i used /scripts/securetmp to secure the /tmp directory on my Cpanel servers. Can someone elaborate on the issue brought up by the customer in the chat session transcript below. Have I caused a problem to our customers who use mysql when I ran /scripts/securetmp?

    Thanks

    ========================
    Support : Hi xxxxxx. How can I help you?
    Customer : MySQL cannot write to: /tmp/#sql_1b9b_0.MYI
    Customer : I looked at /tmp and only root has write privilege,
    Customer : I think maybe that particular file is locked, perhaps, also.
    Support : Yes. /tmp is sometimes used to compile break in programs by hackers. We have secured it.
    Customer : MySQL uses it for temporary tables.
    Support : Hmmm. I am not aware that this is an issue with typical mysql usage. I will have to investigate and get back to you on this one. Are you using PHP to create tables or databases or something of that nature?
    Customer : MySQL uses an environment variable TMPDIR that points to the particular directory. I am not creating tables. When a query runs, the MySQL program may create a temporary table for its own use. I do use PHP, but I also use other tools that failed as well.
    =====================================
     
  2. bmcpanel

    bmcpanel Well-Known Member

    Joined:
    Jun 1, 2002
    Messages:
    546
    Likes Received:
    0
    Trophy Points:
    16
    Thanks. No. /tmp shows 3% usage. Not full.
     
  3. dave9000

    dave9000 Well-Known Member

    Joined:
    Apr 7, 2003
    Messages:
    891
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    arkansas
    cPanel Access Level:
    Root Administrator
    /tmp needs 0666 privledges it must be writtable by any process on the server not just writtable by root
     
  4. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    Do you have a mysql.sock link in your /tmp directory?
     
  5. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    BTW it should point to /var/lib/mysql/mysql.sock
     
  6. bmcpanel

    bmcpanel Well-Known Member

    Joined:
    Jun 1, 2002
    Messages:
    546
    Likes Received:
    0
    Trophy Points:
    16
    Yes, there is a mysql.sock file in the /tmp

    lrwxrwxrwx 1 root root 25 Jun 20 03:16 mysql.sock -> /var/lib/mysql/mysql.sock=
    -rw------- 1 adifffi adisai 142 Jun 26 03:28 sess_3d6227cdd51978b6e6018c9654bf0f5f
    -rw------- 1 adifffi adisai 142 Jun 26 04:32 sess_ec234893bee6b57d2dcf3a93e9de2c09
     
  7. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    N.W. Iowa
    If your having problems with the /tmp folder, change the setting in your my.cnf file, under the [mysqld] group, set your tmpdir:
    Code:
    tmpdir = /path/to_new/tmpfolder
    
    change it and see if that helps.

    Mickalo
     
Loading...

Share This Page