VPS侦探论坛

 找回密码
 注册
查看: 3749|回复: 6

Mysql不能启动,急啊!

[复制链接]
发表于 2016-7-27 03:49:52 | 显示全部楼层 |阅读模式

军哥,我安装的是LNMPA 1.2版,之前一切正常,用了快一年了,今天Mysql不能启动了
按报错信息的文件路径查看,/website/....../xxx.pid,这个文件确实不存在
检查了配置文件,没有找到设置日志文件的选项,我也从来没改过这个
去找/usr/local/mysql/var/主机名.err 也没有找到,这该怎么办?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2016-7-27 08:57:20 | 显示全部楼层


找到主机名.err文件了,和数据目录在一起,数据目录的路径是我手动修改过的,我把刚刚尝试重启Mysql的错误日志贴出来您看看

160727 03:31:44 mysqld_safe mysqld from pid file /website/mysql_data/iZ25eileyjmZ.pid ended
160727 08:53:06 mysqld_safe Starting mysqld daemon with databases from /website/mysql_data
2016-07-27 08:53:06 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-07-27 08:53:06 27646 [Note] Plugin 'FEDERATED' is disabled.
2016-07-27 08:53:06 7f974558d740 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.
2016-07-27 08:53:06 27646 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-07-27 08:53:06 27646 [Note] InnoDB: The InnoDB memory heap is disabled
2016-07-27 08:53:06 27646 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-07-27 08:53:06 27646 [Note] InnoDB: Memory barrier is not used
2016-07-27 08:53:06 27646 [Note] InnoDB: Compressed tables use zlib 1.2.7
2016-07-27 08:53:06 27646 [Note] InnoDB: Using CPU crc32 instructions
2016-07-27 08:53:06 27646 [Note] InnoDB: Initializing buffer pool, size = 2.0G
2016-07-27 08:53:06 27646 [Note] InnoDB: Completed initialization of buffer pool
2016-07-27 08:53:06 27646 [Note] InnoDB: Highest supported file format is Barracuda.
2016-07-27 08:53:06 27646 [Note] InnoDB: 128 rollback segment(s) are active.
2016-07-27 08:53:06 27646 [Note] InnoDB: Waiting for purge to start
2016-07-27 08:53:06 27646 [Note] InnoDB: 5.6.23 started; log sequence number 107310004
2016-07-27 08:53:06 27646 [Note] Server hostname (bind-address): '*'; port: 3306
2016-07-27 08:53:06 27646 [Note] IPv6 is available.
2016-07-27 08:53:06 27646 [Note]   - '::' resolves to '::';
2016-07-27 08:53:06 27646 [Note] Server socket created on IP: '::'.
2016-07-27 08:53:06 27646 [ERROR] Can't start server : Bind on unix socket: Permission denied
2016-07-27 08:53:06 27646 [ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
2016-07-27 08:53:06 27646 [ERROR] Aborting

2016-07-27 08:53:06 27646 [Note] Binlog end
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'partition'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_METRICS'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_CMPMEM'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_CMP'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_LOCKS'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'INNODB_TRX'
2016-07-27 08:53:06 27646 [Note] Shutting down plugin 'InnoDB'
2016-07-27 08:53:06 27646 [Note] InnoDB: FTS optimize thread exiting.
2016-07-27 08:53:06 27646 [Note] InnoDB: Starting shutdown...
2016-07-27 08:53:08 27646 [Note] InnoDB: Shutdown completed; log sequence number 107310014
2016-07-27 08:53:08 27646 [Note] Shutting down plugin 'ARCHIVE'
2016-07-27 08:53:08 27646 [Note] Shutting down plugin 'BLACKHOLE'
2016-07-27 08:53:08 27646 [Note] Shutting down plugin 'MRG_MYISAM'
2016-07-27 08:53:08 27646 [Note] Shutting down plugin 'MyISAM'
2016-07-27 08:53:08 27646 [Note] Shutting down plugin 'CSV'
2016-07-27 08:53:08 27646 [Note] Shutting down plugin 'MEMORY'
2016-07-27 08:53:08 27646 [Note] Shutting down plugin 'sha256_password'
2016-07-27 08:53:08 27646 [Note] Shutting down plugin 'mysql_old_password'
2016-07-27 08:53:08 27646 [Note] Shutting down plugin 'mysql_native_password'
2016-07-27 08:53:08 27646 [Note] Shutting down plugin 'binlog'
2016-07-27 08:53:08 27646 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-7-27 09:02:02 | 显示全部楼层

还有,我的数据目录里多了好多文件,您帮我看看有没有什么问题

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-7-27 10:41:08 | 显示全部楼层



你肯定自己修改过数据库路径,/etc/my.cnf 里有。错误信息上也已经说了你数据库在/website/mysql_data/ 下,错误日志肯定也在那边


2016-07-27 08:53:06 27646 [ERROR] Can't start server : Bind on unix socket: Permission denied
2016-07-27 08:53:06 27646 [ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
2016-07-27 08:53:06 27646 [ERROR] Aborting

按错误信息看估计可能有其他方式安装的mysql包
centos的话:rpm -qa|grep mysql
debian/ubuntu的话:dpkg -l|grep mysql 看一下
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-7-27 12:21:53 | 显示全部楼层

用 rpm -qa | grpe mysql 和 yum list installed | grep mysql 都查了,什么反馈都没有啊

我说一下出问题的过程,最近公司需要部署Git服务器,因此安装了Gitlab,安装后其他都正常,但FTP不能用了

我看了一下日志 /var/log/messages ,提示说mysql.sock找不到

查找 /var/lib/mysql/mysql.sock 文件,是不存在的,但是/tmp/mysql.sock的存在

于是我按照你另一个帖子:https://bbs.vpser.net/thread-13303-2-1.html

执行了 ln -sf /tmp/mysql.sock /var/lib/mysql/mysql.sock 之后,就启动不起来了

现在mysql和ftp都不能用

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2016-7-27 17:08:31 | 显示全部楼层

问题解决了!在解决FTP问题时,发现/var/lib/mysql/mysql.sock文件不存在,而my.cnf里设置的路径是/tmp/mysql.sock。

于是就把my.cnf里的路径改成了/var/lib/mysql/mysql.sock。

现在我给改回去,Mysql就能启动了。估计是之前那个目录的权限问题。

然后我执行了一下ln -sf /tmp/mysql.sock /var/lib/mysql/mysql.sock,现在连接FTP不再报找不到mysql.sock的错误了,却又报别的错:

ul 27 16:53:25 iZ25eileyjmZ pure-ftpd: (?@106.2.217.166) [INFO] New connection from 106.2.217.166
Jul 27 16:53:25 iZ25eileyjmZ pure-ftpd: (?@106.2.217.166) [ERROR] The SQL server seems to be down [Access denied for user 'ftp'@'localhost' (using password: YES)]
Jul 27 16:53:31 iZ25eileyjmZ pure-ftpd: (?@106.2.217.166) [WARNING] Authentication failed for user [lihang]
Jul 27 16:53:31 iZ25eileyjmZ pure-ftpd: (?@106.2.217.166) [INFO] Logout.

可是我用户名密码从来没改过,以前是可以连接的啊?
 楼主| 发表于 2016-7-27 17:26:00 | 显示全部楼层

FTP也解决了,我把mysql里的ftp用户,访问范围改为localhost,密码重置了一下,保持和pureftpd配置文件的一致,重启就好了。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-17 06:34 , Processed in 0.028748 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表