不知道想这么大的数据库文件如何导入呢?备份下来的数据库文件超过一个G
服务器是linux的
本地是XP的
mysql的版本没问题。
导入数据库文件时 运行到一会  命令框直接消失了。(并未出现错误)希望各位大虾指点迷津。(分不够再加哈)

解决方案 »

  1.   

    看下data目录下的.err错误日志文件
    看有什么错误信息
      

  2.   

    估计是字符集设置的问题。检查一下两个数据的字符集设置是否相同。
    http://blog.csdn.net/ACMAIN_CHM/archive/2009/05/12/4174186.aspx
    MySQL 中文显示乱码
    
      

  3.   

    show variables like 'char%';
    ---------------------+------------------------------------+
    able_name            | Value                              |
    ---------------------+------------------------------------+
    acter_set_client     | latin1                             |
    acter_set_connection | latin1                             |
    acter_set_database   | gbk                                |
    acter_set_results    | latin1                             |
    acter_set_server     | latin1                             |
    acter_set_system     | utf8                               |
    acter_sets_dir       | E:\MySQL Datafiles\share\charsets/ |
    ---------------------+------------------------------------+
      

  4.   

    acter_set_database  | gbk      是不是我把要导入的数据库改成GBK?
      

  5.   

    注意:你修改字符标准是需要与Linux 服务器一直。不然,导入依然会出现乱码。
      

  6.   

    建议楼主先按三楼的建议去看一下ERROR LOG中的错误记录。然后可以根据提示做相应的修改。
      

  7.   

    ENGINE=MyISAM DEFAULT CHARSET=gbk; 这个是我从linux服务器导出来的数据中显示的,
    acter_set_database  | gbk           这个是在本地服务器上显示的两者一致吧。
    数据库的日志文件找不到啊date目录下的.err文件只有用机器名命名的一个。090714  8:47:04 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 6  user: 'root'090714  8:47:04 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 5  user: 'root'090714  8:47:04 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 3  user: 'root'090714  8:47:04 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 2  user: 'root'090714  8:47:04 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 1  user: 'root'090714  8:47:04  InnoDB: Starting shutdown...
    090714  8:47:05  InnoDB: Shutdown completed; log sequence number 0 43655
    090714  8:47:05 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Shutdown complete090714  8:47:06  InnoDB: Started; log sequence number 0 43655
    090714  8:47:06 [Note] E:\MySQL Datafiles\bin\mysqld-nt: ready for connections.
    Version: '5.0.15-nt'  socket: ''  port: 3306  Official MySQL binary
    log文件一个都找不到。
      

  8.   

    数据库的日志文件找不到啊date目录下的.err文件只有用机器名命名的一个。这个就是传说中错误日志 你可以查看一下当你执行出错的时间点上有什么错误信息。
      

  9.   

    我已经贴上来了没什么用吧。。 InnoDB: The first specified data file .\ibdata1 did not exist:
    InnoDB: a new database to be created!
    090701 16:57:40  InnoDB: Setting file .\ibdata1 size to 10 MB
    InnoDB: Database physically writes the file full: wait...
    090701 16:57:40  InnoDB: Log file .\ib_logfile0 did not exist: new to be created
    InnoDB: Setting log file .\ib_logfile0 size to 10 MB
    InnoDB: Database physically writes the file full: wait...
    090701 16:57:41  InnoDB: Log file .\ib_logfile1 did not exist: new to be created
    InnoDB: Setting log file .\ib_logfile1 size to 10 MB
    InnoDB: Database physically writes the file full: wait...
    InnoDB: Doublewrite buffer not found: creating new
    InnoDB: Doublewrite buffer created
    InnoDB: Creating foreign key constraint system tables
    InnoDB: Foreign key constraint system tables created
    090701 16:57:41  InnoDB: Started; log sequence number 0 0
    090701 16:57:41 [Note] E:\MySQL Datafiles\bin\mysqld-nt: ready for connections.
    Version: '5.0.15-nt'  socket: ''  port: 3306  Official MySQL binary
    090701 17:28:26 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Normal shutdown090701 17:28:27  InnoDB: Starting shutdown...
    090701 17:28:29  InnoDB: Shutdown completed; log sequence number 0 43655
    090701 17:28:29 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Shutdown complete090702  8:08:00  InnoDB: Started; log sequence number 0 43655
    090702  8:08:00 [Note] E:\MySQL Datafiles\bin\mysqld-nt: ready for connections.
    Version: '5.0.15-nt'  socket: ''  port: 3306  Official MySQL binary
    090702  8:49:53 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Normal shutdown090702  8:49:53  InnoDB: Starting shutdown...
    090702  8:49:56  InnoDB: Shutdown completed; log sequence number 0 43655
    090702  8:49:56 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Shutdown complete090702  8:51:14  InnoDB: Started; log sequence number 0 43655
    090702  8:51:15 [Note] E:\MySQL Datafiles\bin\mysqld-nt: ready for connections.
    Version: '5.0.15-nt'  socket: ''  port: 3306  Official MySQL binary
    090702 14:21:53 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Normal shutdown090702 14:21:55 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 2  user: 'root'090702 14:21:55  InnoDB: Starting shutdown...
    090702 14:21:58  InnoDB: Shutdown completed; log sequence number 0 43655
    090702 14:21:58 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Shutdown complete090702 14:22:01  InnoDB: Started; log sequence number 0 43655
    090702 14:22:01 [Warning] Found invalid password for user: 'zl@localhost'; Ignoring user
    090702 14:22:01 [Note] E:\MySQL Datafiles\bin\mysqld-nt: ready for connections.
    Version: '5.0.15-nt'  socket: ''  port: 3306  Official MySQL binary
    090702 15:00:22 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Normal shutdown090702 15:00:24 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 994  user: 'root'090702 15:00:24  InnoDB: Starting shutdown...
    090702 15:00:25  InnoDB: Shutdown completed; log sequence number 0 43655
    090702 15:00:25 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Shutdown complete090702 15:00:28  InnoDB: Started; log sequence number 0 43655
    090702 15:00:28 [Warning] Found invalid password for user: 'zl@localhost'; Ignoring user
    090702 15:00:28 [Note] E:\MySQL Datafiles\bin\mysqld-nt: ready for connections.
    Version: '5.0.15-nt'  socket: ''  port: 3306  Official MySQL binary
    090702 15:09:14 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Normal shutdown090702 15:09:16 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 15  user: 'root'090702 15:09:16 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 14  user: 'root'090702 15:09:16 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 13  user: 'root'090702 15:09:16 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 12  user: 'root'090702 15:09:16 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 11  user: 'root'090702 15:09:16 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 10  user: 'root'090702 15:09:16  InnoDB: Starting shutdown...
    090702 15:09:18  InnoDB: Shutdown completed; log sequence number 0 43655
    090702 15:09:18 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Shutdown complete090702 15:09:21  InnoDB: Started; log sequence number 0 43655
    090702 15:09:21 [Warning] Found invalid password for user: 'zl@localhost'; Ignoring user
    090702 15:09:21 [Note] E:\MySQL Datafiles\bin\mysqld-nt: ready for connections.
    Version: '5.0.15-nt'  socket: ''  port: 3306  Official MySQL binary
    090702 15:15:06 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Normal shutdown090702 15:15:08 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 14  user: 'root'090702 15:15:08 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 12  user: 'root'090702 15:15:08 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 11  user: 'root'090702 15:15:08 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 10  user: 'root'090702 15:15:08 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 9  user: 'root'090702 15:15:08 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 8  user: 'root'090702 15:15:08 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 7  user: 'root'090702 15:15:08  InnoDB: Starting shutdown...
    090702 15:15:11  InnoDB: Shutdown completed; log sequence number 0 43655
    090702 15:15:11 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Shutdown complete090702 15:15:14  InnoDB: Started; log sequence number 0 43655
    090702 15:15:14 [Note] E:\MySQL Datafiles\bin\mysqld-nt: ready for connections.
    Version: '5.0.15-nt'  socket: ''  port: 3306  Official MySQL binary
    090702 15:17:01 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Normal shutdown090702 15:17:03 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 10  user: 'root'090702 15:17:03 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 9  user: 'root'090702 15:17:03 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 8  user: 'root'090702 15:17:03 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 7  user: 'root'090702 15:17:03 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 6  user: 'root'090702 15:17:03  InnoDB: Starting shutdown...
    090702 15:17:06  InnoDB: Shutdown completed; log sequence number 0 43655
    090702 15:17:06 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Shutdown complete090702 15:17:08  InnoDB: Started; log sequence number 0 43655
    090702 15:17:08 [Note] E:\MySQL Datafiles\bin\mysqld-nt: ready for connections.
    Version: '5.0.15-nt'  socket: ''  port: 3306  Official MySQL binary
    090703 17:36:26 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Normal shutdown090703 17:36:26  InnoDB: Starting shutdown...
    090703 17:36:28  InnoDB: Shutdown completed; log sequence number 0 43655
    090703 17:36:28 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Shutdown complete090706  7:53:05  InnoDB: Started; log sequence number 0 43655
    090706  7:53
    090714  8:47:04 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 6  user: 'root' 090714  8:47:04 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 5  user: 'root' 090714  8:47:04 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 3  user: 'root' 090714  8:47:04 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 2  user: 'root' 090714  8:47:04 [Warning] E:\MySQL Datafiles\bin\mysqld-nt: Forcing close of thread 1  user: 'root' 090714  8:47:04  InnoDB: Starting shutdown... 
    090714  8:47:05  InnoDB: Shutdown completed; log sequence number 0 43655 
    090714  8:47:05 [Note] E:\MySQL Datafiles\bin\mysqld-nt: Shutdown complete 090714  8:47:06  InnoDB: Started; log sequence number 0 43655 
    090714  8:47:06 [Note] E:\MySQL Datafiles\bin\mysqld-nt: ready for connections. 
    Version: '5.0.15-nt'  socket: ''  port: 3306  Official MySQL binary 
      

  10.   

    没人来了吗?
    单表导入出现乱码 这是咋回事?
    linux服务器上字符集是GBK
    本地服务器的字符集也是GBK
    为什么还乱码呀?
      

  11.   

    你从linux上导出的文件中,字符是否正常?
      

  12.   

    把这个文件中的SQL语句逐句执行看一下哪一句有问题。
      

  13.   

    直接在命令框理输入 
    use database
    set names 'gbk';
    source e:/database.sql这个没问题吧?
      

  14.   

    难道是我提供的信息太少了吗? 各位需要什么信息才能了解呀?
    现在单表导入已经没问题了 。不乱码了。
    原来就是在执行导入之前 先执行 set names 'gbk';
    然后再导入就不乱码了。但是现在整个库导入 还是有问题 不知道问题在哪。
    我发现服务器数据库里有很多表都是空的。还有某些表的某些字段也是空的 
    会不会是这个问题。
    还有 用另一个早一点的备份文件导入时(比现在的小一点) ,命令框不会跳掉,但报错。date too lang 什么的。。
      

  15.   

    根据 13 楼错误日志来看,应该是你限制了表空间的大小;你检查下你数据文件Size大小如何。
      

  16.   

    这个问题我今天也碰到了
    把%mysql_home%/MYSQL Server/my_large.ini文件拷贝到安装数据库的根目录下,名字改为my.cnf,把里面max_allowed_packet = 1M改大就OK了。
      

  17.   

    你说的是文件拷到linux服务器目录下去?
    可我现在是linux正常,本地的xp系统下的mysql导不进去啊?
    本地xp系统下的my_large.ini本来就在根目录的哇。
      

  18.   

    前提,你要有4G或者4G以上的内存。修改变量值:MySQL安装目录下的my.ini文件中的[mysqld]段中的“max_allowed_packet = 2048M”(如果没有这行内容,增加一行),保存,重起MySQL服务这个是修改缓存,因为你的文件比较大,所以要把缓存修改的比你的文件还大,呵呵。
      

  19.   

    所以,可能的话,以后还是用postgreSQL吧