netrope 发表于 2016-7-27 03:49:52

Mysql不能启动,急啊!

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

netrope 发表于 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 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 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 InnoDB: Using atomics to ref count buffer pool pages
2016-07-27 08:53:06 27646 InnoDB: The InnoDB memory heap is disabled
2016-07-27 08:53:06 27646 InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-07-27 08:53:06 27646 InnoDB: Memory barrier is not used
2016-07-27 08:53:06 27646 InnoDB: Compressed tables use zlib 1.2.7
2016-07-27 08:53:06 27646 InnoDB: Using CPU crc32 instructions
2016-07-27 08:53:06 27646 InnoDB: Initializing buffer pool, size = 2.0G
2016-07-27 08:53:06 27646 InnoDB: Completed initialization of buffer pool
2016-07-27 08:53:06 27646 InnoDB: Highest supported file format is Barracuda.
2016-07-27 08:53:06 27646 InnoDB: 128 rollback segment(s) are active.
2016-07-27 08:53:06 27646 InnoDB: Waiting for purge to start
2016-07-27 08:53:06 27646 InnoDB: 5.6.23 started; log sequence number 107310004
2016-07-27 08:53:06 27646 Server hostname (bind-address): '*'; port: 3306
2016-07-27 08:53:06 27646 IPv6 is available.
2016-07-27 08:53:06 27646    - '::' resolves to '::';
2016-07-27 08:53:06 27646 Server socket created on IP: '::'.
2016-07-27 08:53:06 27646 Can't start server : Bind on unix socket: Permission denied
2016-07-27 08:53:06 27646 Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
2016-07-27 08:53:06 27646 Aborting

2016-07-27 08:53:06 27646 Binlog end
2016-07-27 08:53:06 27646 Shutting down plugin 'partition'
2016-07-27 08:53:06 27646 Shutting down plugin 'PERFORMANCE_SCHEMA'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_SYS_DATAFILES'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_SYS_TABLESPACES'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_SYS_FOREIGN'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_SYS_FIELDS'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_SYS_COLUMNS'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_SYS_INDEXES'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_SYS_TABLESTATS'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_SYS_TABLES'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_FT_CONFIG'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_FT_BEING_DELETED'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_FT_DELETED'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_METRICS'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_BUFFER_PAGE'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_CMP_PER_INDEX'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_CMPMEM_RESET'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_CMPMEM'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_CMP_RESET'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_CMP'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_LOCK_WAITS'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_LOCKS'
2016-07-27 08:53:06 27646 Shutting down plugin 'INNODB_TRX'
2016-07-27 08:53:06 27646 Shutting down plugin 'InnoDB'
2016-07-27 08:53:06 27646 InnoDB: FTS optimize thread exiting.
2016-07-27 08:53:06 27646 InnoDB: Starting shutdown...
2016-07-27 08:53:08 27646 InnoDB: Shutdown completed; log sequence number 107310014
2016-07-27 08:53:08 27646 Shutting down plugin 'ARCHIVE'
2016-07-27 08:53:08 27646 Shutting down plugin 'BLACKHOLE'
2016-07-27 08:53:08 27646 Shutting down plugin 'MRG_MYISAM'
2016-07-27 08:53:08 27646 Shutting down plugin 'MyISAM'
2016-07-27 08:53:08 27646 Shutting down plugin 'CSV'
2016-07-27 08:53:08 27646 Shutting down plugin 'MEMORY'
2016-07-27 08:53:08 27646 Shutting down plugin 'sha256_password'
2016-07-27 08:53:08 27646 Shutting down plugin 'mysql_old_password'
2016-07-27 08:53:08 27646 Shutting down plugin 'mysql_native_password'
2016-07-27 08:53:08 27646 Shutting down plugin 'binlog'
2016-07-27 08:53:08 27646 /usr/local/mysql/bin/mysqld: Shutdown complete

netrope 发表于 2016-7-27 09:02:02

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

licess 发表于 2016-7-27 10:41:08

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


2016-07-27 08:53:06 27646 Can't start server : Bind on unix socket: Permission denied
2016-07-27 08:53:06 27646 Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
2016-07-27 08:53:06 27646 Aborting
按错误信息看估计可能有其他方式安装的mysql包
centos的话:rpm -qa|grep mysql
debian/ubuntu的话:dpkg -l|grep mysql 看一下

netrope 发表于 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都不能用

netrope 发表于 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) New connection from 106.2.217.166
Jul 27 16:53:25 iZ25eileyjmZ pure-ftpd: (?@106.2.217.166) The SQL server seems to be down
Jul 27 16:53:31 iZ25eileyjmZ pure-ftpd: (?@106.2.217.166) Authentication failed for user
Jul 27 16:53:31 iZ25eileyjmZ pure-ftpd: (?@106.2.217.166) Logout.

可是我用户名密码从来没改过,以前是可以连接的啊?

netrope 发表于 2016-7-27 17:26:00

FTP也解决了,我把mysql里的ftp用户,访问范围改为localhost,密码重置了一下,保持和pureftpd配置文件的一致,重启就好了。
页: [1]
查看完整版本: Mysql不能启动,急啊!