急,哪位师傅帮帮我,mysql启动不了服务器是swvps,装的wamp,mysql是5.1.36,由于空间满了,昨天检查发现mysql下很多类似mysql-bin.000001的文件,于是就把它删除了,然后将ini文件里面的一个log什么的命令注释掉,然后mysql就启动不了了,不知道会不会删除很多0000文件的时候误删除了有用的文件,现在我该怎么办呢?

解决方案 »

  1.   

    有无错误日志之类的,ERR。LOG?
      

  2.   

    你把日志里的.index文件删掉试试
      

  3.   

    贴出你的/etc/my.cnf另外也贴出你的错误日志中的内容。
      

  4.   

    win2003,my.ini# Example MySQL config file for medium systems.
    #
    # This is for a system with little memory (32M - 64M) where MySQL plays
    # an important part, or systems up to 128M where MySQL is used together with
    # other programs (such as a web server)
    #
    # You can copy this file to
    # /etc/my.cnf to set global options,
    # mysql-data-dir/my.cnf to set server-specific options (in this
    # installation this directory is C:\mysql\data) or
    # ~/.my.cnf to set user-specific options.
    #
    # In this file, you can use all long options that a program supports.
    # If you want to know which options a program supports, run the program
    # with the "--help" option.# The following options will be passed to all MySQL clients
    [client]
    #password = your_password
    port = 3306
    socket = /tmp/mysql.sock# Here follows entries for some specific programs# The MySQL server
    [wampmysqld]
    port = 3306
    socket = /tmp/mysql.sock
    skip-locking
    key_buffer = 16M
    max_allowed_packet = 1M
    table_cache = 64
    sort_buffer_size = 512K
    net_buffer_length = 8K
    read_buffer_size = 256K
    read_rnd_buffer_size = 512K
    myisam_sort_buffer_size = 8M
    basedir=c:/wamp/bin/mysql/mysql5.1.36
    log-error=c:/wamp/logs/mysql.log
    datadir=c:/wamp/bin/mysql/mysql5.1.36/data# Don't listen on a TCP/IP port at all. This can be a security enhancement,
    # if all processes that need to connect to mysqld run on the same host.
    # All interaction with mysqld must be made via Unix sockets or named pipes.
    # Note that using this option without enabling named pipes on Windows
    # (via the "enable-named-pipe" option) will render mysqld useless!

    #skip-networking# Disable Federated by default
    skip-federated# Replication Master Server (default)
    # binary logging is required for replication
    #log-bin=mysql-bin# binary logging format - mixed recommended
    binlog_format=mixed# required unique id between 1 and 2^32 - 1
    # defaults to 1 if master-host is not set
    # but will not function as a master if omitted
    server-id = 1# Replication Slave (comment out master section to use this)
    #
    # To configure this host as a replication slave, you can choose between
    # two methods :
    #
    # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
    #    the syntax is:
    #
    #    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
    #    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
    #
    #    where you replace <host>, <user>, <password> by quoted strings and
    #    <port> by the master's port number (3306 by default).
    #
    #    Example:
    #
    #    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
    #    MASTER_USER='joe', MASTER_PASSWORD='secret';
    #
    # OR
    #
    # 2) Set the variables below. However, in case you choose this method, then
    #    start replication for the first time (even unsuccessfully, for example
    #    if you mistyped the password in master-password and the slave fails to
    #    connect), the slave will create a master.info file, and any later
    #    change in this file to the variables' values below will be ignored and
    #    overridden by the content of the master.info file, unless you shutdown
    #    the slave server, delete master.info and restart the slaver server.
    #    For that reason, you may want to leave the lines below untouched
    #    (commented) and instead use CHANGE MASTER TO (see above)
    #
    # required unique id between 2 and 2^32 - 1
    # (and different from the master)
    # defaults to 2 if master-host is set
    # but will not function as a slave if omitted
    #server-id       = 2
    #
    # The replication master for this slave - required
    #master-host     =   <hostname>
    #
    # The username the slave will use for authentication when connecting
    # to the master - required
    #master-user     =   <username>
    #
    # The password the slave will authenticate with when connecting to
    # the master - required
    #master-password =   <password>
    #
    # The port the master is listening on.
    # optional - defaults to 3306
    #master-port     =  <port>
    #
    # binary logging - not required for slaves, but recommended
    #log-bin=mysql-bin# Point the following paths to different dedicated disks
    #tmpdir = /tmp/
    #log-update  = /path-to-dedicated-directory/hostname# Uncomment the following if you are using InnoDB tables
    #innodb_data_home_dir = C:\mysql\data/
    #innodb_data_file_path = ibdata1:10M:autoextend
    #innodb_log_group_home_dir = C:\mysql\data/
    #innodb_log_arch_dir = C:\mysql\data/
    # You can set .._buffer_pool_size up to 50 - 80 %
    # of RAM but beware of setting memory usage too high
    #innodb_buffer_pool_size = 16M
    #innodb_additional_mem_pool_size = 2M
    # Set .._log_file_size to 25 % of buffer pool size
    #innodb_log_file_size = 5M
    #innodb_log_buffer_size = 8M
    #innodb_flush_log_at_trx_commit = 1
    #innodb_lock_wait_timeout = 50[mysqldump]
    quick
    max_allowed_packet = 16Mmax_connections=500 [mysql]
    no-auto-rehash
    # Remove the next comment character if you are not familiar with SQL
    #safe-updates[isamchk]
    key_buffer = 20M
    sort_buffer_size = 20M
    read_buffer = 2M
    write_buffer = 2M[myisamchk]
    key_buffer = 20M
    sort_buffer_size = 20M
    read_buffer = 2M
    write_buffer = 2M[mysqlhotcopy]
    interactive-timeout[mysqld]
    port=3306
      

  5.   

    就是这个地方的mysql-bin.000020' 被我删除了
    100827  2:03:21 [Note] wampmysqld: Normal shutdown100827  2:03:21 [Note] Event Scheduler: Purging the queue. 0 events
    100827  2:03:22  InnoDB: Starting shutdown...
    100827  2:03:24  InnoDB: Shutdown completed; log sequence number 0 46419
    100827  2:03:24 [Warning] Forcing shutdown of 1 plugins
    100827  2:03:25 [Note] wampmysqld: Shutdown complete100827  2:03:29 [ERROR] You need to use --log-bin to make --binlog-format work.
    100827  2:03:29 [ERROR] Aborting100827  2:03:29 [Note] wampmysqld: Shutdown complete100827  6:44:27 [ERROR] You need to use --log-bin to make --binlog-format work.
    100827  6:44:27 [ERROR] Aborting100827  6:44:27 [Note] wampmysqld: Shutdown complete100827  7:03:42 [ERROR] You need to use --log-bin to make --binlog-format work.
    100827  7:03:42 [ERROR] Aborting100827  7:03:43 [Note] wampmysqld: Shutdown complete100827  7:09:41 [Note] Plugin 'FEDERATED' is disabled.
    100827  7:09:41  InnoDB: Started; log sequence number 0 46419
    wampmysqld: File '.\mysql-bin.000020' not found (Errcode: 2)
    100827  7:09:41 [ERROR] Failed to open log (file '.\mysql-bin.000020', errno 2)
    100827  7:09:41 [ERROR] Could not open log file
    100827  7:09:41 [ERROR] Can't init tc log
    100827  7:09:41 [ERROR] Aborting100827  7:09:41  InnoDB: Starting shutdown...
    100827  7:09:42  InnoDB: Shutdown completed; log sequence number 0 46419
    100827  7:09:42 [Warning] Forcing shutdown of 1 plugins
    100827  7:09:42 [Note] wampmysqld: Shutdown complete100827  7:11:20 [Note] Plugin 'FEDERATED' is disabled.
    100827  7:11:20  InnoDB: Started; log sequence number 0 46419
    wampmysqld: File '.\mysql-bin.000020' not found (Errcode: 2)
    100827  7:11:20 [ERROR] Failed to open log (file '.\mysql-bin.000020', errno 2)
    100827  7:11:20 [ERROR] Could not open log file
    100827  7:11:20 [ERROR] Can't init tc log
    100827  7:11:20 [ERROR] Aborting100827  7:11:20  InnoDB: Starting shutdown...
    100827  7:11:21  InnoDB: Shutdown completed; log sequence number 0 46419
    100827  7:11:21 [Warning] Forcing shutdown of 1 plugins
    100827  7:11:21 [Note] wampmysqld: Shutdown complete100827  7:15:28 [Note] Plugin 'FEDERATED' is disabled.
    100827  7:15:28  InnoDB: Started; log sequence number 0 46419
    wampmysqld: File '.\mysql-bin.000020' not found (Errcode: 2)
    100827  7:15:28 [ERROR] Failed to open log (file '.\mysql-bin.000020', errno 2)
    100827  7:15:28 [ERROR] Could not open log file
    100827  7:15:28 [ERROR] Can't init tc log
    100827  7:15:28 [ERROR] Aborting100827  7:15:28  InnoDB: Starting shutdown...
    100827  7:15:30  InnoDB: Shutdown completed; log sequence number 0 46419
    100827  7:15:30 [Warning] Forcing shutdown of 1 plugins
    100827  7:15:30 [Note] wampmysqld: Shutdown complete100827  7:33:55 [ERROR] You need to use --log-bin to make --binlog-format work.
    100827  7:33:55 [ERROR] Aborting100827  7:33:55 [Note] wampmysqld: Shutdown complete100827  7:35:04 [ERROR] You need to use --log-bin to make --binlog-format work.
    100827  7:35:04 [ERROR] Aborting100827  7:35:04 [Note] wampmysqld: Shutdown complete
      

  6.   

    把 .index删除掉就可以了。或者你删除全部文件,只保留ib_logfile0,ib_logfile1,ibdata1
    然后重新启动服务。
      

  7.   

    这个也要注释掉
    binlog_format=mixed