2台linux  mysql   a 机器  b 机器现在想法是 把a 机器的mysql的数据 物理 迁移搞到 b机器
(也就是 aj机器 的mysql 服务停掉之后copy数据到b 机器 
之后在b机器的mysql服务停掉 数据复制完后 在重启mysqll的服务

但现在突然发现b机器有这个错误 ::
100613 21:14:03  mysqld started
100613 21:18:11  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
100613 21:18:11  mysqld ended100613 21:18:40  mysqld started
100613 21:22:48  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
100613 21:22:48  mysqld ended100613 21:23:19  mysqld started
100613 21:27:27  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.
100613 21:27:27  mysqld ended(都是32的os ,但是2个mysql的版本不一致。  一个是5.0.77 一个是5.0.42)
                        这个该如何解决 

解决方案 »

  1.   

    文件没copy全吧。
    data目录下边有很多文件的,还有文件夹。
      

  2.   

    a 机器是 /var/lib  
    我tar xzvf mysql该目录全部copy了我把所有目录 之后copy过去再还原的 
    因该咩有问ite 
    是2个mysql的版本不一致。 一个是5.0.77 一个是5.0.42)-------------这个哟影响没有
      

  3.   

    周3在2个同版本linux mysql上测试成功 今天死活都不成  (还在测试复制成功 还是哟收获的 )明早继续
      

  4.   

    InnoDB: The error means mysqld does not have the access rights to
    检查一下权限设置。
      

  5.   

    有新错误 
    starting Mysql.manager of pid-file without updating.......
    回忆我冷备份覆盖了目的库 的 /var/lib/mysql/mysql.sock
    结果总是提示找不到 /var/lib/mysql/mysql.sock
      

  6.   

    13.2.7. Moving an InnoDB Database to Another Machine
    On Windows, InnoDB always stores database and table names internally in lowercase. To move databases in a binary format from Unix to Windows or from Windows to Unix, you should create all databases and tables using lowercase names. A convenient way to accomplish this is to add the following line to the [mysqld] section of your my.cnf or my.ini file before creating any databases or tables: [mysqld]
    lower_case_table_names=1
    Like MyISAM data files, InnoDB data and log files are binary-compatible on all platforms having the same floating-point number format. You can move an InnoDB database simply by copying all the relevant files listed in Section 13.2.6, “Backing Up and Recovering an InnoDB Database”. If the floating-point formats differ but you have not used FLOAT or DOUBLE data types in your tables, then the procedure is the same: simply copy the relevant files. If you use mysqldump to dump your tables on one machine and then import the dump files on the other machine, it does not matter whether the formats differ or your tables contain floating-point data. One way to increase performance is to switch off autocommit mode when importing data, assuming that the tablespace has enough space for the big rollback segment that the import transactions generate. Do the commit only after importing a whole table or a segment of a table. Copyright © 1997, 2010, Oracle and/or its affiliates. All rights reserved. Legal Notices 
    Previous / Next / Up / Table of Contents
    User Comments
    Posted by Daniel Solin on January 13 2003 6:54am [Delete] [Edit] When moving a database between two machines where the floating-point values are not compatible, this solution can be easier (depending on the number and complexity of your tables). If you have a very large database with just a few FLOAT and/or DOUBLE columns, it is definitely worth to consider:1. On the source machine, convert any DOUBLE and/or FLOAT column(s) to CHAR(50) (adjust the length of the string to your needs).
    2. Shut down the MySQL server on the source machine.
    3. Copy the binary files to the target machine.
    4. Start the MySQL server on the target machine.
    5. On the target machine, convert the column(s) in question back to FLOAT and/or DOUBLE.
    Posted by Steven Casey on August 15 2004 9:15pm [Delete] [Edit] It would be really nice to have an example of the syntax or the steps necessary to move the database, instead of sending everyone all over the documentation to try to find it.
    Posted by Stephen Saine on June 26 2007 10:49pm [Delete] [Edit] FYI -- If you are moving binary copies of InnoDB tables from Ubuntu to Mac OSX or Windows, make sure the lower_case_table_names=0 flag is set otherwise you get "ERROR 1146 (42S02): Table ‘db.table’ doesn’t exist"http://stephensaine.com/?p=5
    Posted by michael skramstad on October 26 2008 7:57am [Delete] [Edit] I hope this solution saves you some frustration, as I spent several hours to get it to work. To free disk space on my primary server I moved non-clustered innodb databases to another server, which became an NFS server, and I created an NFS mount on the primary server (NFS client). Hour after hour I saw the following error in /var/log/syslog:Oct 25 15:46:22 master mysqld[11434]: 081025 15:46:22 InnoDB: Operating system error number 13 in a file operation.
    Oct 25 15:46:22 master mysqld[11434]: InnoDB: The error means mysqld does not have the access rights to
    Oct 25 15:46:22 master mysqld[11434]: InnoDB: the directory.
    Oct 25 15:46:22 master mysqld[11434]: InnoDB: File name ./ibdata1
    Oct 25 15:46:22 master mysqld[11434]: InnoDB: File operation call: 'open'.
    Oct 25 15:46:22 master mysqld[11434]: InnoDB: Cannot continue operation.
    Oct 25 15:46:22 master mysqld_safe[11440]: ended
    Oct 25 15:46:36 master /etc/init.d/mysql[11590]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf
    ping' resulted in
    Oct 25 15:46:36 master /etc/init.d/mysql[11590]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
    Oct 25 15:46:36 master /etc/init.d/mysql[11590]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysq
    ld.sock' (2)'
    Oct 25 15:46:36 master /etc/init.d/mysql[11590]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' 
    exists!Since I use Ubuntu Hardy I had to add the new database location to apparmor's /etc/apparmor.d/usr.sbin.mysqld file. I did this on both the server and client. I also added the mysql user to the groups adm and admin on the NFS server.After doing a chown -R mysql:adm on the new database location it finally worked. http://www.mikeskramstad.comPosted by David Byrd on May 4 2010 6:54am [Delete] [Edit] I moved all databases on an old Ubuntu 9.10 server to a new Ubuntu 9.10 server using a single tar file:
    1. stop the mysql daemon on the source pc (gui or cli)
    2. tar the data folders /var/lib/mysql
    cd /var/lib
    sudo tar -zcvpf <target_path>/<archive_file_name>.tar.gz mysql/*
    3. shut down the mysql daemon on the target server
    4. cd /var/lib
    5. sudo tar -xzvpf <archive_file_name>.tar.gz
    6. restart the mysql daemon on the target serverPlease, do not use this method unless you have the same versions of mysql installed on both servers. Also note that this will completely overwrite the target server's mysql instance. If you have a database on the target server that you want to keep do not use this method!
    Add 
    现在版本不同 如何解决  
    100613 21:18:11 InnoDB: Operating system error number 13 in a file operation/etc/SElinux/config  里 配置 pessive 
    但当前我的linux 是 centos , 问该如何配置???
      

  7.   

    Re: InnoDB: Operating system error number 13 in a file operation.
    Posted by: Steve Nilan () 
    Date: January 31, 2008 05:52PM
    Hi, I recently had the same problem as you when trying to use raw partitions 
    in mysql.. If you are using SE linux, set it to permissive mode by editing /etc/selinux/config and changing 
    SELINUX=enforcing to SELINUX=permissive This solved all of my problems with the 
    "Operating system error number 13 in a file operation" error
    /etc/SElinux/config 里 配置 pessive  
    但当前我的linux 是 centos , 问该如何配置???
      

  8.   

    /etc/SElinux/config 里 配置 pessive   
    搞定这个问题 。 信心与实力大增  (源机器是32位os , 目的是64位os 这样来的问it)接着又开了一个虚拟机器,继续模拟第2个错误2台linux  mysql   a 机器  b 机器现在想法是 把a 机器的mysql的数据 物理 迁移搞到 b机器
    (也就是 aj机器 的mysql 服务停掉之后copy数据到b 机器 
    之后在b机器的mysql服务停掉 数据复制完后 在重启mysqll的服务

    但现在突然发现b机器有这个错误 :: 
    有新错误  
    starting Mysql.manager of pid-file without updating.......不知道如何解决 ? 
      

  9.   

    这个mysql server 感觉难度不大 。 ps -ef |grep mysql
    回应为空  说明压根服务没有启动错路 登录日志
    100614 18:47:40 [Note] Plugin 'FEDERATED' is disabled.
    /usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
    100614 18:47:40 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    /usr/sbin/mysqld: Can't create/write to file '/tmp/ibZGStar' (Errcode: 28)
    100614 18:47:40  InnoDB: Error: unable to create temporary file; errno: 28
    100614 18:47:40 [ERROR] Plugin 'InnoDB' init function returned error.
    100614 18:47:40 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
    /usr/sbin/mysqld: File '/var/log/mysql/slow-queries.log' not found (Errcode: 13)
    100614 18:47:40 [ERROR] Could not use /var/log/mysql/slow-queries.log for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
    100614 18:47:40 [ERROR] Unknown/unsupported table type: INNODB
    100614 18:47:40 [ERROR] Aborting100614 18:47:40 [Note] /usr/sbin/mysqld: Shutdown complete100614 18:47:40 mysqld_safe mysqld from pid file /var/lib/mysql//localhost.localdomain.pid ended
    100614 18:50:09 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql/
    100614 18:50:10 [Warning] The syntax '--log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '--slow_query_log'/'--slow_query_log_file' instead.
    100614 1100614 18:50:11 mysqld_safe mysqld from pid file /var/lib/mysql//localhost.localdomain.pid ended
    100614 18:52:43 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    100614 18:52:43 [Note] Plugin 'FEDERATED' is disabled.
    /usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
    100614 18:52:43 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    /usr/sbin/mysqld: Can't create/write to file '/tmp/ibbbNoq6' (Errcode: 28)
    100614 18:52:43  InnoDB: Error: unable to create temporary file; errno: 28
    100614 18:52:43 [ERROR] Plugin 'InnoDB' init function returned error.
    100614 18:52:43 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
    100614 18:52:43 [ERROR] /usr/sbin/mysqld: Can't create/write to file '/var/lib/mysql/localhost.localdomain.pid' (Errcode: 28)
    100614 18:52:43 [ERROR] Can't start server: can't create PID file: No space left on device
    100614 18:52:43 mysqld_safe mysqld from pid file /var/lib/mysql/localhost.localdomain.pid ended
    100614 19:06:33 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    100614 19:06:34 [Note] Plugin 'FEDERATED' is disabled.
    /usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
    100614 19:06:34 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    /usr/sbin/mysqld: Can't create/write to file '/tmp/ibpeF9hw' (Errcode: 28)
    100614 19:06:34  InnoDB: Error: unable to create temporary file; errno: 28
    100614 19:06:34 [ERROR] Plugin 'InnoDB' init function returned error.
    100614 19:06:34 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
    100614 19:06:34 [ERROR] /usr/sbin/mysqld: Can't create/write to file '/var/lib/mysql/localhost.localdomain.pid' (Errcode: 28)
    100614 19:06:34 [ERROR] Can't start server: can't create PID file: No space left on device
    100614 19:06:34 mysqld_safe mysqld from pid file /var/lib/mysql/localhost.localdomain.pid ended
    100614 19:13:52 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
    100614 19:13:52 [Note] Plugin 'FEDERATED' is disabled.
    /usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist
    100614 19:13:52 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    /usr/sbin/mysqld: Can't create/write to file '/tmp/ibsnszpP' (Errcode: 28)
    100614 19:13:52  InnoDB: Error: unable to create temporary file; errno: 28
    100614 19:13:52 [ERROR] Plugin 'InnoDB' init function returned error.
    100614 19:13:52 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
    100614 19:13:52 [ERROR] /usr/sbin/mysqld: Can't create/write to file '/var/lib/mysql/localhost.localdomain.pid' (Errcode: 28)
    100614 19:13:52 [ERROR] Can't start server: can't create PID file: No space left on device
    100614 19:13:52 mysqld_safe mysqld from pid file /var/lib/mysql/localhost.localdomain.pid end