我是复制的方式把数据库复制出来的(里面的表是.frm格式文件),然后重新安装了mysql,   我想把数据库导入到现在的mysql里面,粘贴好像不行,听别人说,可能是版本不同的原因,识别不出来(有人说要修改某些配置才行)我应该怎么弄才能让现在的mysql识别出来呢,真的很急~~谢谢指点!mysql

解决方案 »

  1.   

    是表中的数据?
    除非是MYISAM的,可以直接COPY,否则用MYSQLDUMP备份再导入
      

  2.   

    表中的结构定义是存放在FRM文件,而数据如果你不骨看MYD文件则是存放在上层目录的ibdata1中。
      

  3.   

    如果表不多且复制的表是MyISAM表的话,那么在数据库中建立同名的同引擎的表,在关闭服务器,把你之前复制的.frm文件复制进去,覆盖掉你刚刚建。如果是InnoDB表的话,除了复制了.frm文件还要把InnoDB的各种表空间文件复制进去,
      

  4.   

    myisam可以直接的复制就可以了。否则mysqldump备份。
      

  5.   

    复制出来data目录是可以的  但是必须先停止数据库服务 
      

  6.   

    我也不太清楚我截个图吧   
    我就想把这里面zly 这个数据库弄到我现在的mysql里面来。 光复制zly这个目录进来是不行的,识别不出来。
    zly目录里面全是。frm文件
      

  7.   

    整个目录都是我以前的mysql里面拷贝出来的
      

  8.   

    用navicat客户端就可以,试过很多次
      

  9.   

    mysqldump -uroot -proot --databases design >d:/design.sql
    用mysqldump肯定比直接复制要简单啊。。
    先备份:>mysqldump -uroot -ppasswd --databases zly >d:/zly.sql
    然后恢复:>mysql -uroot -ppasswd  < d:/zly.sql
    就两个命令,很容易
      

  10.   

    问题是我复制的时候没有停掉mysql呢。
      

  11.   

    问题是我复制的时候没有停掉mysql呢。数据有可能出问题
      

  12.   

    用mysqldump导出来多好啊。你把innodb的那个log删除后试试。
      

  13.   

    删除前,先备份。你试试,如果不行。你看看PC_ZLY.err中的错误日志是什么。贴出来。你目前的问题是这样吧:
    你copy了mysql的数据文件目录。重新安装了mysql。所以你的数据就存在你copy出来的那个目录了。你在有mysqldump已经完了。数据库都没了。用毛啊。你现在就试着恢复。备份一定要做好。
    如果不行。我在自己在我本地做一个实验看看什么文件需要改。LZ这种COPY是可以的。
      

  14.   

    差不多就你说的这个问题,这个pc_zly.err 文件也不太懂~~  ,急需解决,十分感谢!
      

  15.   

    把pc_zly.err 文件的内容贴出来看看
      

  16.   

    130306 18:08:23 [Note] Giving client threads a chance to die gracefully
    130306 18:08:23 [Note] Event Scheduler: Purging the queue. 0 events
    130306 18:08:23 [Note] Shutting down slave threads
    130306 18:08:23 [Note] Forcefully disconnecting remaining clients
    130306 18:08:23 [Note] Binlog end
    130306 18:08:23 [Note] Shutting down plugin 'partition'
    130306 18:08:23 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_FT_DELETED'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_FT_INSERTED'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_METRICS'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_CMPMEM'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_CMP_RESET'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_CMP'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_LOCKS'
    130306 18:08:23 [Note] Shutting down plugin 'INNODB_TRX'
    130306 18:08:23 [Note] Shutting down plugin 'InnoDB'
    130306 18:08:23 InnoDB: FTS optimize thread exiting.
    130306 18:08:23 InnoDB: Starting shutdown...
    130306 18:08:23 InnoDB: Shutdown completed; log sequence number 2483746
    130306 18:08:23 [Note] Shutting down plugin 'BLACKHOLE'
    130306 18:08:23 [Note] Shutting down plugin 'ARCHIVE'
    130306 18:08:23 [Note] Shutting down plugin 'MRG_MYISAM'
    130306 18:08:23 [Note] Shutting down plugin 'MyISAM'
    130306 18:08:23 [Note] Shutting down plugin 'MEMORY'
    130306 18:08:23 [Note] Shutting down plugin 'CSV'
    130306 18:08:23 [Note] Shutting down plugin 'mysql_old_password'
    130306 18:08:23 [Note] Shutting down plugin 'mysql_native_password'
    130306 18:08:23 [Note] Shutting down plugin 'binlog'
    130306 18:08:23 [Note] C:\mysql\Sql1\bin\mysqld: Shutdown complete130306 19:07:29 [Note] Plugin 'FEDERATED' is disabled.
    130306 19:07:32 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
    130306 19:07:32 InnoDB: The InnoDB memory heap is disabled
    130306 19:07:32 InnoDB: Mutexes and rw_locks use Windows interlocked functions
    130306 19:07:32 InnoDB: Compressed tables use zlib 1.2.3
    130306 19:07:32 InnoDB: CPU does not support crc32 instructions
    130306 19:07:32 InnoDB: Initializing buffer pool, size = 107.0M
    130306 19:07:32 InnoDB: Completed initialization of buffer pool
    130306 19:07:32 InnoDB: highest supported file format is Barracuda.
    130306 19:07:32 InnoDB: 128 rollback segment(s) are active.
    130306 19:07:32 InnoDB: Waiting for the background threads to start
    130306 19:07:32 InnoDB: 1.2.5 started; log sequence number 2483746
    130306 19:07:32 [Note] Event Scheduler: Loaded 0 events
    130306 19:07:32 [Note] C:\mysql\Sql1\bin\mysqld: ready for connections.
    Version: '5.6.5-m8'  socket: ''  port: 3306  MySQL Community Server (GPL)
    130306 22:36:02 [Note] C:\mysql\Sql1\bin\mysqld: Normal shutdown130306 22:36:02 [Note] Giving client threads a chance to die gracefully
    130306 22:36:02 [Note] Event Scheduler: Purging the queue. 0 events
    130306 22:36:02 [Note] Shutting down slave threads
    130306 22:36:02 [Note] Forcefully disconnecting remaining clients
    130306 22:36:02 [Note] Binlog end
    130306 22:36:02 [Note] Shutting down plugin 'partition'
    130306 22:36:02 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_FT_DELETED'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_FT_INSERTED'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_METRICS'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_CMPMEM'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_CMP_RESET'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_CMP'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_LOCKS'
    130306 22:36:02 [Note] Shutting down plugin 'INNODB_TRX'
    130306 22:36:02 [Note] Shutting down plugin 'InnoDB'
    130306 22:36:02 InnoDB: FTS optimize thread exiting.
    130306 22:36:02 InnoDB: Starting shutdown...
    130306 22:36:03 InnoDB: Shutdown completed; log sequence number 2483756
    130306 22:36:03 [Note] Shutting down plugin 'BLACKHOLE'
    130306 22:36:03 [Note] Shutting down plugin 'ARCHIVE'
    130306 22:36:03 [Note] Shutting down plugin 'MRG_MYISAM'
    130306 22:36:03 [Note] Shutting down plugin 'MyISAM'
    130306 22:36:03 [Note] Shutting down plugin 'MEMORY'
    130306 22:36:03 [Note] Shutting down plugin 'CSV'
    130306 22:36:03 [Note] Shutting down plugin 'mysql_old_password'
    130306 22:36:03 [Note] Shutting down plugin 'mysql_native_password'
    130306 22:36:03 [Note] Shutting down plugin 'binlog'
    130306 22:36:03 [Note] C:\mysql\Sql1\bin\mysqld: Shutdown complete
      

  17.   

    130403 10:53:11 [ERROR] Cannot find or open table zly/connect from
    the internal data dictionary of InnoDB though the .frm file for the
    table exists. Maybe you have deleted and recreated InnoDB data
    files but have forgotten to delete the corresponding .frm files
    of InnoDB tables, or you have moved .frm files to another database?
    or, the table contains indexes that this version of the engine
    doesn't support.
    See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html
    how you can resolve the problem.130403 10:53:11 [ERROR] Cannot find or open table zly/content from
    the internal data dictionary of InnoDB though the .frm file for the
    table exists. Maybe you have deleted and recreated InnoDB data
    files but have forgotten to delete the corresponding .frm files
    of InnoDB tables, or you have moved .frm files to another database?
    or, the table contains indexes that this version of the engine
    doesn't support.
    See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html
    how you can resolve the problem.130403 10:53:11 [ERROR] Cannot find or open table zly/login from
    the internal data dictionary of InnoDB though the .frm file for the
    table exists. Maybe you have deleted and recreated InnoDB data
    files but have forgotten to delete the corresponding .frm files
    of InnoDB tables, or you have moved .frm files to another database?
    or, the table contains indexes that this version of the engine
    doesn't support.
    See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html
    how you can resolve the problem.130403 10:53:11 [ERROR] Cannot find or open table zly/person from
    the internal data dictionary of InnoDB though the .frm file for the
    table exists. Maybe you have deleted and recreated InnoDB data
    files but have forgotten to delete the corresponding .frm files
    of InnoDB tables, or you have moved .frm files to another database?
    or, the table contains indexes that this version of the engine
    doesn't support.
    See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html
    how you can resolve the problem.130403 10:53:11 [ERROR] Cannot find or open table zly/photo from
    the internal data dictionary of InnoDB though the .frm file for the
    table exists. Maybe you have deleted and recreated InnoDB data
    files but have forgotten to delete the corresponding .frm files
    of InnoDB tables, or you have moved .frm files to another database?
    or, the table contains indexes that this version of the engine
    doesn't support.
    See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html
    how you can resolve the problem.130403 10:53:11 [ERROR] Cannot find or open table zly/photo_block from
    the internal data dictionary of InnoDB though the .frm file for the
    table exists. Maybe you have deleted and recreated InnoDB data
    files but have forgotten to delete the corresponding .frm files
    of InnoDB tables, or you have moved .frm files to another database?
    or, the table contains indexes that this version of the engine
    doesn't support.
    See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html
    how you can resolve the problem.130403 10:53:11 [ERROR] Cannot find or open table zly/photoreview from
    the internal data dictionary of InnoDB though the .frm file for the
    table exists. Maybe you have deleted and recreated InnoDB data
    files but have forgotten to delete the corresponding .frm files
    of InnoDB tables, or you have moved .frm files to another database?
    or, the table contains indexes that this version of the engine
    doesn't support.
    See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html
    how you can resolve the problem.130403 10:53:11 [ERROR] Cannot find or open table zly/review from
    the internal data dictionary of InnoDB though the .frm file for the
    table exists. Maybe you have deleted and recreated InnoDB data
    files but have forgotten to delete the corresponding .frm files
    of InnoDB tables, or you have moved .frm files to another database?
    or, the table contains indexes that this version of the engine
    doesn't support.
    See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html
    how you can resolve the problem.130403 10:53:12 [ERROR] Cannot find or open table zly/content from
    the internal data dictionary of InnoDB though the .frm file for the
    table exists. Maybe you have deleted and recreated InnoDB data
    files but have forgotten to delete the corresponding .frm files
    of InnoDB tables, or you have moved .frm files to another database?
    or, the table contains indexes that this version of the engine
    doesn't support.
    See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html
    how you can resolve the problem.130403 10:53:14 [ERROR] Cannot find or open table zly/login from
    the internal data dictionary of InnoDB though the .frm file for the
    table exists. Maybe you have deleted and recreated InnoDB data
    files but have forgotten to delete the corresponding .frm files
    of InnoDB tables, or you have moved .frm files to another database?
    or, the table contains indexes that this version of the engine
    doesn't support.
    See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html
    how you can resolve the problem.这个是另外个
      

  18.   

    你之前卸载的mysql版本是几。现在重新安装的是几。
    http://blog.csdn.net/xiangliangyu2008/article/details/8450765
      

  19.   


    之前卸载的mysql 不知道 是哪个版本了 不知道是5.5 还是5.6  现在又全部被我重新卸载了