手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

MySQL移动数据存放目录及问题

[日期:2013-12-26] 来源:Linux社区  作者:fuwenchao [字体:大 中 小]

在这个过程中出现的问题
问题描述:当我在MySQL-front工具上连接mysql数据库时没有问题,但是当我在命令行连接时报错:
[root@pacteralinux weixindemo]# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/mnt/resource/mysqldate/mysql.sock' (2)

很奇怪,这个路径不是改过嘛,看代码:

#socket =/mnt/resource/mysqldate/mysql.sock
socket =/mnt/mntsdc2formysql/mysqldata/mysql.sock

但是为什么还是报以前的路径错误,以为问题出在启动脚本上/etc/init.d/mysqld ,但是看了下,启动脚本里面没有设置socket相关项了!没办法,还是把/etc/init.d/mysqld的datedir改为现在的安装路径
123 [root@pacteralinux ~]# vi /etc/init.d/mysqld
basedir=/mnt/resource/mysqldate
datadir=

重启还是报同样的错,没办法,看下错误日志吧:
131226 13:32:38 mysqld_safe mysqld from pid file /mnt/resource/mysqldate/pacteralinux.pid ended
131226 13:56:18 mysqld_safe Starting mysqld daemon with databases from /mnt/mntsdc2formysql/mysqldata
2013-12-26 13:56:19 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2013-12-26 13:56:19 7837 [Note] Plugin 'FEDERATED' is disabled.
2013-12-26 13:56:19 7837 [Note] InnoDB: The InnoDB memory heap is disabled
2013-12-26 13:56:19 7837 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-12-26 13:56:19 7837 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-12-26 13:56:19 7837 [Note] InnoDB: Not using CPU crc32 instructions
2013-12-26 13:56:19 7837 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2013-12-26 13:56:19 7837 [Note] InnoDB: Completed initialization of buffer pool
2013-12-26 13:56:19 7837 [Note] InnoDB: Highest supported file format is Barracuda.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/doc_type'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."doc_type"', ignored.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/documents'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."documents"', ignored.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/menu_event_response_config'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."menu_event_response_config"', ignored.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/pictures'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."pictures"', ignored.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/response_config'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."response_config"', ignored.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/sys_function'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."sys_function"', ignored.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/sys_function_catalog'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."sys_function_catalog"', ignored.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/sys_orgnization'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."sys_orgnization"', ignored.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/sys_role'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."sys_role"', ignored.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/sys_role_function'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."sys_role_function"', ignored.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/sys_user'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."sys_user"', ignored.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/sys_user_role'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."sys_user_role"', ignored.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/usr_chat_his'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."usr_chat_his"', ignored.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/usr_message'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."usr_message"', ignored.
2013-12-26 13:56:19 7fac674d7720  InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Could not find a valid tablespace file for 'weixin/wx_config'. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2013-12-26 13:56:19 7837 [ERROR] InnoDB: Tablespace open failed for '"weixin"."wx_config"', ignored.
2013-12-26 13:56:19 7837 [Note] InnoDB: 128 rollback segment(s) are active.
2013-12-26 13:56:20 7837 [Note] InnoDB: Waiting for purge to start
2013-12-26 13:56:20 7837 [Note] InnoDB: 5.6.14 started; log sequence number 2138639
2013-12-26 13:56:20 7837 [Note] Server hostname (bind-address): '*'; port: 3306
2013-12-26 13:56:20 7837 [Note] IPv6 is available.
2013-12-26 13:56:20 7837 [Note]  - '::' resolves to '::';
2013-12-26 13:56:20 7837 [Note] Server socket created on IP: '::'.
2013-12-26 13:56:20 7837 [Note] Event Scheduler: Loaded 0 events
2013-12-26 13:56:20 7837 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.6.14'  socket: '/mnt/mntsdc2formysql/mysqldata/mysql.sock'  port: 3306  Source distribution
2013-12-26 14:42:17 7837 [Warning] IP address '182.151.205.254' could not be resolved: Name or service not known

 

算了,其他的错先不看,最后几行说的那是啥,不能解析主机,越来不懂了
不死心,再看下/etc/my.cnf文件
哈哈,发现了这个
# *** upgrade to a newer version of MySQL.
[client]
socket =/mnt/resource/mysqldate/mysql.sock

哇咔,改为现在目录启动OK

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款