mysql不会在ubuntu服务器16.04上重新启动

ldxq2e6h  于 2021-06-21  发布在  Mysql
关注(0)|答案(2)|浏览(427)

mysql不会再次重新启动,出现以下错误:

Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.

下面是错误日志:

sudo tail -30 /var/log/mysql/error.log
2018-07-09T18:22:31.107868Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-07-09T18:22:31.204826Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-07-09T18:22:31.707270Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-07-09T18:22:31.707323Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-07-09T18:22:31.709057Z 0 [Warning] InnoDB: 1048576 bytes should have been written. Only 376832 bytes written. Retrying for the remaining bytes.
2018-07-09T18:22:31.709080Z 0 [Warning] InnoDB: Retry attempts for writing partial data failed.
2018-07-09T18:22:31.709092Z 0 [ERROR] InnoDB: Write to file ./ibtmp1failed at offset 2097152, 1048576 bytes should have been written, only 376832 were written. Operating system error number 28. Check that your OS and file system support files of this size. Check also that the disk is not full or a disk quota exceeded.
2018-07-09T18:22:31.709103Z 0 [ERROR] InnoDB: Error number 28 means 'No space left on device'
2018-07-09T18:22:31.709110Z 0 [Note] InnoDB: Some operating system error numbers are described at http://dev.mysql.com/doc/refman/5.7/en/operating-system-error-codes.html
2018-07-09T18:22:31.709119Z 0 [ERROR] InnoDB: Could not set the file size of './ibtmp1'. Probably out of disk space
2018-07-09T18:22:31.709126Z 0 [ERROR] InnoDB: Unable to create the shared innodb_temporary
2018-07-09T18:22:31.709133Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-07-09T18:22:32.210454Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-07-09T18:22:32.210480Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-07-09T18:22:32.210490Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-07-09T18:22:32.210500Z 0 [ERROR] Failed to initialize builtin plugins.
2018-07-09T18:22:32.210508Z 0 [ERROR] Aborting

2018-07-09T18:22:32.210527Z 0 [Note] Binlog end
2018-07-09T18:22:32.219434Z 0 [Note] Shutting down plugin 'MyISAM'
2018-07-09T18:22:32.219459Z 0 [Note] Shutting down plugin 'CSV'

请问有谁出了这个错误?

bgibtngc

bgibtngc1#

我认为在这种情况下,仔细阅读信息可以帮你很大的忙。你的留言说。。。
2018-07-09t18:22:31.709092z 0[错误]innodb:写入文件。/IBMP1在偏移量2097152处失败,应写入1048576字节,仅写入376832。操作系统错误号28。检查操作系统和文件系统是否支持此大小的文件。还要检查磁盘是否未满或超过了磁盘配额。
2018-07-09t18:22:31.709103z 0[错误]innodb:错误号28表示“设备上没有剩余空间”
看起来保存mysql数据的磁盘已满。做 df -h .

Filesystem Size Used Avail Use% Mounted on 
/dev/root  20G   19G    0  100%  / 
devtmpfs  7.9G     0 7.9G    0%  /dev 
tmpfs     7.9G     0 7.9G    0%  /dev/shm 
tmpfs     7.9G   14M 7.9G    1%  /run 
tmpfs     5.0M     0 5.0M    0%  /run/lock 
tmpfs     7.9G     0 7.9G    0%  /sys/fs/cgroup 
tmpfs     7.9G     0 7.9G    0%  /run/shm 
/dev/sda2 487M   22M 437M    5%  /boot 
/dev/sda4 1.8T  376M 1.7T    1%  /home

ubuntu/debian将mysql放在/var/lib/mysql。在你的机器上 /var 在根文件系统上,显示在 df 输出。文件系统已满。
如果不知道系统中还有什么,就很难确切地告诉你该做什么。但是,您的/var目录树需要位于一个更大的文件系统中,或者您需要弄清楚如何将mysql数据放在/home下。

4ioopgfo

4ioopgfo2#

myql无法启动,因为正如journalctl输出所示,但您尚未提供必需的server-id。请按下面的代码所示添加必需的id。

/etc/mysql/mysql.conf.d/mysqld.cnf

更改自:

log-bin=mysql-bin
binlog-format = 'ROW'

更改为:

server-id=master-01
log-bin=mysql-bin
binlog-format = 'ROW'

这将使您的服务器运行,而您的地址正确格式化您想要的日志记录。
非致命警告:
对于错误的“打开文件”限制,您必须减少所编辑配置中的需求,或增加系统限制:

/etc/security/limits.conf

* soft nofile [new number]
* hard nofile [new number]

第一栏描述了申请限额的人是通配符,表示所有用户。要提高root的限制,必须显式输入“root”而不是“”。

相关问题