Need help with my.cnf running php4/mysql4

Discussion in 'Site & Server Administration' started by articledirectory, Nov 3, 2009.

  1. #1
    I have a dedi box running centos and directadmin
    I wanted the server setup running php4 / mysql 4 so i can run some old oscommerce sites that wont work on php5 and with the default install of the server i was having problems with users not being able to connect to the databases, too many connections, i found out that a defualt install of php4 has no my.cnf setting so i copied the ones found here

    this fixed the connections problem but i am finding that the server is starting to overload and shutting down the mail sever and then stopping httpd from running resulting in me having to restart the server on a daily basis

    I am getting some support from the hosting company but nothing seems to be helping at the moment

    can anyone recomend what the ideal set up for the my.cnf file should be, sever spec is below, if you need any other information post or PM me I'm online all day and will respond quickly

    server spec is:
    Processor Name Intel(R) Xeon(TM) CPU 3.06GHz
    Vendor ID GenuineIntel
    Processor Speed (MHz) 3066.085
    Processor Name Intel(R) Xeon(TM) CPU 3.06GHz
    Vendor ID GenuineIntel
    Processor Speed (MHz) 3066.085
    Processor Name Intel(R) Xeon(TM) CPU 3.06GHz
    Vendor ID GenuineIntel
    Processor Speed (MHz) 3066.085
    Processor Name Intel(R) Xeon(TM) CPU 3.06GHz
    Vendor ID GenuineIntel
    Processor Speed (MHz) 3066.085
    Total Memory 4155120 kB
    Free Memory 2039696 kB
    Total Swap Memory 6062072 kB
    Free Swap Memory 6062072 kB
    System Uptime 0 Days, 1 Hours and 48 Minutes
    Apache 2.2.14 Running
    DirectAdmin 1.34.1 Running
    Exim 4.67 Running
    MySQL 4.1.22 Running
    Named 9.3.6 Running
    ProFTPd 1.3.1 Running
    sshd Running
    dovecot 1.2.6 Running
     
    articledirectory, Nov 3, 2009 IP
  2. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #2
    You can increase connection from my.cnf. If the file /etc/my.cnf in blank you can add following line:

    [mysqld]
    max_connections=XXXX

    Replace XXX with number of connection you want to allow. You will need to restart mysql service after making changes.

    Kailash
     
    kailash, Nov 6, 2009 IP
  3. articledirectory

    articledirectory Peon

    Messages:
    1,704
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #3
    There should of been a link in my original post to show what i put in my.cnf file
    this is what it currntly looks like

    [mysqld]
    #datadir=/var/lib/mysql
    #socket=/var/lib/mysql/mysql.sock
    skip-locking
    skip-innodb
    query_cache_limit=1M
    query_cache_size=32M
    query_cache_type=1
    max_connections=500
    interactive_timeout=100
    wait_timeout=100
    connect_timeout=10
    thread_cache_size=128
    key_buffer=16M
    join_buffer=1M
    max_allowed_packet=16M
    table_cache=1024
    record_buffer=1M
    sort_buffer_size=2M
    read_buffer_size=2M
    max_connect_errors=10
    # Try number of CPU's*2 for thread_concurrency
    thread_concurrency=2
    myisam_sort_buffer_size=64M
    log-bin
    server-id=1

    [mysql.server]
    user=mysql
    basedir=/var/lib

    [safe_mysqld]
    err-log=/var/log/mysqld.log
    #pid-file=/var/lib/mysql/mysql.pid
    open_files_limit=8192

    [mysqldump]
    quick
    max_allowed_packet=16M

    [mysql]
    no-auto-rehash
    #safe-updates

    [isamchk]
    key_buffer=64M
    sort_buffer=64M
    read_buffer=16M
    write_buffer=16M

    [myisamchk]
    key_buffer=64M
    sort_buffer=64M
    read_buffer=16M
    write_buffer=16M

    [mysqlhotcopy]
    interactive-timeout
     
    articledirectory, Nov 7, 2009 IP