UOS系统安装mariadb数据库,装完重启计算机之后就用不了

系统UOS家庭版,在自己电脑上搭了个环境做做测试,中间件那些倒是没有问题,就是mariadb一直不对,刚安装完时可以正常修改配置和使用。只要把电脑重启再来启动mariadb就起不来了。

一开始以为是修改了数据库存储路径的问题,反复卸载安装多次之后发现即使用默认配置,只要重启电脑就不能用。

查看日志感觉是权限问题(瞎猜的),试过sudo和直接切root安装,都是一样的结果。

root@ming:/home/ming# systemctl start mariadb
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

重启之后启动这样报错,查了很多方法都解决不了,特来求助,error日志如下:

2021-11-18  8:40:57 0 [Note] InnoDB: Using Linux native AIO
2021-11-18  8:40:57 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-11-18  8:40:57 0 [Note] InnoDB: Uses event mutexes
2021-11-18  8:40:57 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-11-18  8:40:57 0 [Note] InnoDB: Number of pools: 1
2021-11-18  8:40:57 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-11-18  8:40:57 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-11-18  8:40:57 0 [Note] InnoDB: Completed initialization of buffer pool
2021-11-18  8:40:57 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-11-18  8:40:57 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-11-18  8:40:57 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-11-18  8:40:57 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-11-18  8:40:57 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-11-18  8:40:57 0 [Note] InnoDB: 10.3.29 started; log sequence number 1625443; transaction id 20
2021-11-18  8:40:57 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2021-11-18  8:40:57 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-11-18  8:40:57 0 [Note] InnoDB: Buffer pool(s) load completed at 211118  8:40:57
2021-11-18  8:40:57 0 [Note] Server socket created on IP: '127.0.0.1'.
2021-11-18  8:40:57 0 [Note] Reading of all Master_info entries succeeded
2021-11-18  8:40:57 0 [Note] Added new Master_info '' to hash table
2021-11-18  8:40:57 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.3.29-MariaDB-0+deb10u1'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Debian 20
2021-11-18  8:47:29 0 [Note] /usr/sbin/mysqld (initiated by: unknown): Normal shutdown
2021-11-18  8:47:29 0 [Note] Event Scheduler: Purging the queue. 0 events
2021-11-18  8:47:29 0 [Note] InnoDB: FTS optimize thread exiting.
2021-11-18  8:47:29 0 [Note] InnoDB: Starting shutdown...
2021-11-18  8:47:29 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2021-11-18  8:47:29 0 [Note] InnoDB: Buffer pool(s) dump completed at 211118  8:47:29
2021-11-18  8:47:30 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-11-18  8:47:30 0 [Note] InnoDB: Shutdown completed; log sequence number 1625452; transaction id 25
2021-11-18  8:47:30 0 [Note] /usr/sbin/mysqld: Shutdown complete

2021-11-18  8:47:31 0 [Note] InnoDB: Using Linux native AIO
2021-11-18  8:47:31 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-11-18  8:47:31 0 [Note] InnoDB: Uses event mutexes
2021-11-18  8:47:31 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-11-18  8:47:31 0 [Note] InnoDB: Number of pools: 1
2021-11-18  8:47:31 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-11-18  8:47:31 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-11-18  8:47:31 0 [Note] InnoDB: Completed initialization of buffer pool
2021-11-18  8:47:31 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-11-18  8:47:31 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-11-18  8:47:31 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-11-18  8:47:31 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-11-18  8:47:31 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-11-18  8:47:31 0 [Note] InnoDB: 10.3.29 started; log sequence number 1625452; transaction id 20
2021-11-18  8:47:31 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2021-11-18  8:47:31 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-11-18  8:47:31 0 [Note] InnoDB: Buffer pool(s) load completed at 211118  8:47:31
2021-11-18  8:47:31 0 [Note] Server socket created on IP: '127.0.0.1'.
2021-11-18  8:47:31 0 [Note] Reading of all Master_info entries succeeded
2021-11-18  8:47:31 0 [Note] Added new Master_info '' to hash table
2021-11-18  8:47:31 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.3.29-MariaDB-0+deb10u1'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Debian 20
2021-11-18  8:47:46 0 [Note] /usr/sbin/mysqld (initiated by: unknown): Normal shutdown
2021-11-18  8:47:46 0 [Note] Event Scheduler: Purging the queue. 0 events
2021-11-18  8:47:46 0 [Note] InnoDB: FTS optimize thread exiting.
2021-11-18  8:47:46 0 [Note] InnoDB: Starting shutdown...
2021-11-18  8:47:46 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2021-11-18  8:47:46 0 [Note] InnoDB: Buffer pool(s) dump completed at 211118  8:47:46
2021-11-18  8:47:49 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-11-18  8:47:49 0 [Note] InnoDB: Shutdown completed; log sequence number 1625461; transaction id 21
2021-11-18  8:47:49 0 [Note] /usr/sbin/mysqld: Shutdown complete

_**重启之后如下**_
2021-11-18  8:52:18 0 [ERROR] mysqld: Can't lock aria control file '/var/lib/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
2021-11-18  8:52:49 0 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/var/lib/mysql/aria_log_control'
2021-11-18  8:52:49 0 [ERROR] Plugin 'Aria' init function returned error.
2021-11-18  8:52:49 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2021-11-18  8:52:49 0 [Note] InnoDB: Using Linux native AIO
2021-11-18  8:52:49 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-11-18  8:52:49 0 [Note] InnoDB: Uses event mutexes
2021-11-18  8:52:49 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-11-18  8:52:49 0 [Note] InnoDB: Number of pools: 1
2021-11-18  8:52:49 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-11-18  8:52:49 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-11-18  8:52:49 0 [Note] InnoDB: Completed initialization of buffer pool
2021-11-18  8:52:49 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-11-18  8:52:49 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2021-11-18  8:52:49 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2021-11-18  8:52:49 0 [Note] InnoDB: Retrying to lock the first data file
2021-11-18  8:52:50 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
_**中间重复部分省略**_
2021-11-18  8:54:29 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2021-11-18  8:54:29 0 [Note] InnoDB: Unable to open the first data file
2021-11-18  8:54:29 0 [ERROR] InnoDB: Operating system error number 11 in a file operation.
2021-11-18  8:54:29 0 [ERROR] InnoDB: Error number 11 means 'Resource temporarily unavailable'
2021-11-18  8:54:29 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2021-11-18  8:54:29 0 [ERROR] InnoDB: Cannot open datafile './ibdata1'
2021-11-18  8:54:29 0 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2021-11-18  8:54:29 0 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file
2021-11-18  8:54:29 0 [Note] InnoDB: Starting shutdown...
2021-11-18  8:54:30 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-11-18  8:54:30 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-11-18  8:54:30 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-11-18  8:54:30 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2021-11-18  8:54:30 0 [ERROR] Aborting

Warning: Memory not freed: 520

已解决,未设置服务器自启,手动启动会出现上述问题,设置自启之后正常。
设置服务自启动:systemctl enable mariadb