我用“/ Volumes / x”创建了一个mysql实例作为数据目录。我想把它移到“Volumes / y”。但是,这会抛出一个错误,指出mysql表不存在,并且数据库存在致命错误。
有没有办法将数据目录移动到不同的位置?
当我尝试移动数据目录时,我得到以下错误。顺便说一下,我用/ etc / my.cnf更新了新路径的位置。我仍然遇到这些错误。
130219 19:26:33 [Note] Plugin 'FEDERATED' is disabled. /usr/local/mysql/bin/mysqld: Table 'mysql.plugin' doesn't exist 130219 19:26:33 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 130219 19:26:33 InnoDB: The InnoDB memory heap is disabled 130219 19:26:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins 130219 19:26:33 InnoDB: Compressed tables use zlib 1.2.3 130219 19:26:33 InnoDB: Initializing buffer pool, size = 2.0G 130219 19:26:33 InnoDB: Completed initialization of buffer pool 130219 19:26:33 InnoDB: highest supported file format is Barracuda. 130219 19:26:33 InnoDB: Waiting for the background threads to start 130219 19:26:34 InnoDB: 5.5.30 started; log sequence number 1593283 130219 19:26:34 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306 130219 19:26:34 [Note] - '0.0.0.0' resolves to '0.0.0.0'; 130219 19:26:34 [Note] Server socket created on IP: '0.0.0.0'. 130219 19:26:34 [ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it 130219 19:26:34 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist 130219 19:26:34 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'threads' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure 130219 19:26:34 [ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure 130219 19:26:34 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50091, now running 50530. Please use mysql_upgrade to fix this error. 130219 19:26:34 [ERROR] mysql.user has no `Event_priv` column at position 29 130219 19:26:34 [ERROR] Cannot open mysql.event 130219 19:26:34 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler. 130219 19:26:34 [Note] /usr/local/mysql/bin/mysqld: ready for connections. Version: '5.5.30' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL)
我运行了mysql_upgrade,下面是输出,如果我在之后重启,则没有错误。我仍然担心为什么我会看到错误。
/usr/local/mysql/bin/mysql_upgrade: the '--datadir' option is always ignored Looking for 'mysql' as: /usr/local/mysql/bin/mysql Looking for 'mysqlcheck' as: /usr/local/mysql/bin/mysqlcheck Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql.sock' Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql.sock' bala_test.bala_1 OK bala_test.bala_2 OK mysql.columns_priv OK mysql.db OK mysql.func OK mysql.help_category error : Table upgrade required. Please do "REPAIR TABLE `help_category`" or dump/reload to fix it! mysql.help_keyword error : Table upgrade required. Please do "REPAIR TABLE `help_keyword`" or dump/reload to fix it! mysql.help_relation OK mysql.help_topic error : Table upgrade required. Please do "REPAIR TABLE `help_topic`" or dump/reload to fix it! mysql.host OK mysql.proc error : Table upgrade required. Please do "REPAIR TABLE `proc`" or dump/reload to fix it! mysql.procs_priv error : Table upgrade required. Please do "REPAIR TABLE `procs_priv`" or dump/reload to fix it! mysql.tables_priv OK mysql.time_zone OK mysql.time_zone_leap_second OK mysql.time_zone_name error : Table upgrade required. Please do "REPAIR TABLE `time_zone_name`" or dump/reload to fix it! mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK Repairing tables mysql.help_category OK mysql.help_keyword OK mysql.help_topic OK mysql.proc OK mysql.procs_priv OK mysql.time_zone_name OK Running 'mysql_fix_privilege_tables'... OK