linux 下 Mysql 数据访问量也不是很大,为什么老是死掉,要重启数据库才能访问 !请问下 mysql 的配置应该如果调整 ..

解决方案 »

  1.   

    你配置下mysql,有很多专门对大数据量的配置,你网上可以搜索一下。
    我用过appserv的套件,安装好以后在MYSQL 的安装目录下有个my-huge.ini my-huge.ini my-innodb-heavy-4G.ini这几个配置文件。你可以参考一下
      

  2.   

    运行的时候看下同时有多少个连接连在数据库上,如果访问量不大但连接数又很多的话可能是代码问题,需要优化哈,另外可能是mysql配置问题,把缓存什么的配置多点看看呢
      

  3.   

    什么系统?什么版本的mysql(是否是linux系统自带的,还是自己后来安装上去的)估计还是mysql设置的问题.网上找找资料吧,对linux也不是很熟悉.
      

  4.   

    报这个错connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (11)'
    Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!帮我看下这到底是怎么回事,明明这个/tmp/mysql.sock是OK的,而且我是早上看的,根本网站没什么流量,我都怀疑是被攻击了...
    迷茫...
      

  5.   

    贴出mysql日志和apache日志,linux发行版本。
      

  6.   

    080417 18:32:25  mysqld started
    InnoDB: The first specified data file ./ibdata1 did not exist:
    InnoDB: a new database to be created!
    080417 18:32:25  InnoDB: Setting file ./ibdata1 size to 10 MB
    InnoDB: Database physically writes the file full: wait...
    080417 18:32:26  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
    InnoDB: Setting log file ./ib_logfile0 size to 5 MB
    InnoDB: Database physically writes the file full: wait...
    080417 18:32:26  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
    InnoDB: Setting log file ./ib_logfile1 size to 5 MB
    InnoDB: Database physically writes the file full: wait...
    080417 19:35:49  mysqld started
    InnoDB: No valid checkpoint found.
    InnoDB: If this error appears when you are creating an InnoDB database,
    InnoDB: the problem may be that during an earlier attempt you managed
    InnoDB: to create the InnoDB data files, but log file creation failed.
    InnoDB: If that is the case, please refer to
    InnoDB: http://dev.mysql.com/doc/refman/5.0/en/error-creating-innodb.html
    080417 19:35:50 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
    080417 19:35:50  mysqld ended080417 19:41:52  mysqld started
    /usr/local/mysql/libexec/mysqld: Too many arguments (first extra is 'user=mysql').
    Use --help to get a list of available options
    080417 19:41:52  mysqld ended080417 19:43:32  mysqld started
    InnoDB: No valid checkpoint found.
    InnoDB: If this error appears when you are creating an InnoDB database,
    InnoDB: the problem may be that during an earlier attempt you managed
    InnoDB: to create the InnoDB data files, but log file creation failed.
    InnoDB: If that is the case, please refer to
    InnoDB: http://dev.mysql.com/doc/refman/5.0/en/error-creating-innodb.html
    080417 19:43:32 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
    080417 19:43:33  mysqld ended080417 19:46:49  mysqld started
    InnoDB: No valid checkpoint found.
    InnoDB: If this error appears when you are creating an InnoDB database,
    InnoDB: the problem may be that during an earlier attempt you managed
    InnoDB: to create the InnoDB data files, but log file creation failed.
    InnoDB: If that is the case, please refer to
    InnoDB: http://dev.mysql.com/doc/refman/5.0/en/error-creating-innodb.html
    "localhost.localdomain.err" 177L, 10059C
      

  7.   

     Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
      

  8.   

    my.cnf配置如下[client]
    default-character-set=utf8
    #password       = your_password
    port            = 3306
    socket          = /tmp/mysql.sock# Here follows entries for some specific programs# The MySQL server
    [mysqld]
    default-character-set=utf8
    skip-name-resolve
    skip-grant-tables
    port            = 3306
    socket          = /tmp/mysql.sock
    skip-locking
    key_buffer_size = 128M
    table_cache = 256
    sort_buffer_size = 8M
    net_buffer_length = 16K
    read_buffer_size = 8M
    read_rnd_buffer_size = 512K
    myisam_sort_buffer_size = 8M
    connect_timeout = 20
    max_connections = 1024
    wait_timeout = 20
    interactive_timeout = 10
    query_cache_size = 64M
    log-slow-queries = /usr/local/mysql/slowquery.log
    long_query_time = 2
      

  9.   


    这个问题 ,我以前也碰到过。我上次的解决办法跟权限有关,正巧前两周硬盘坏了。。上次怎么解决就在硬盘上记录的。。
    我linux一般用的版本是RH4和ubuntu 8.03。想赚点你的分都不行了,太巧和了,和我一样的错误。
      

  10.   

    CPU
    E2140 双核1.6G/PD2.8G 双核
    内存
    1G DDR II
    硬盘
    SATA-160GB
    网卡
    1000M×2
    服务器尺寸
    1U
    硬盘分区
    Linux  2G SWAP 其余剩余服务器就这配置...
      

  11.   

    手动映射一个mysql.sock文件到你的tmp目录下。1. stop mysql
    2. run the commands# cd /tmp
    # ln -s /var/lib/mysql/mysql.sock mysql.sock //根据你的版本找到你的原始文件地址映射。
    3. start mysql 
      

  12.   

    。。大人。小人有罪,为什么你一直不说你的linux发行版本呢?
    这个很重要的。。
    ubuntu/centerOS/RH/Solaris/每个发行版本的情况都不一样的哦。
      

  13.   

    不是啊,mysql.sock是有的,不是那个问题,但当 mysql 死掉的时候就报那个错..
      

  14.   

    我 mysql.sock在/tmp/  目录下是没有问题的,重启mysql问题就好了, 可以还是抗不了多久 就不行了 !非常的郁闷,而且服务器访问量并不大,麻烦大家看一下我的my.cnf的配置,和我服务器的配置,是不是有问题...