麒麟在线

当前位置:网站首页 / 技术 / 正文

新版aapanel、BT面板安装mariadb 10.3后无法新建数据库怎么办

后台查看mariadb的启动状态还是正常的 Active: active (running)

service mysql status

但就是无法创建数据库,无法连接数据库

查看Mariadb的错误日志

250520 11:18:05 mysqld_safe mysqld from pid file /www/server/data/ovh.pid ended
250520 11:18:06 mysqld_safe Starting mysqld daemon with databases from /www/server/data
2025-05-20 11:18:06 0 [Warning] You need to use --log-bin to make --binlog-format work.
2025-05-20 11:18:06 0 [Warning] option 'max_allowed_packet': unsigned value 107374182400 adjusted to 1073741824
2025-05-20 11:18:06 0 [Note] /www/server/mysql/bin/mysqld (mysqld 10.3.31-MariaDB-log) starting as process 14722 ...
2025-05-20 11:18:06 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2025-05-20 11:18:06 0 [Note] InnoDB: Uses event mutexes
2025-05-20 11:18:06 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2025-05-20 11:18:06 0 [Note] InnoDB: Number of pools: 1
2025-05-20 11:18:06 0 [Note] InnoDB: Using SSE2 crc32 instructions
2025-05-20 11:18:06 0 [Note] InnoDB: Initializing buffer pool, total size = 1G, instances = 8, chunk size = 128M
2025-05-20 11:18:06 0 [Note] InnoDB: Completed initialization of buffer pool
2025-05-20 11:18:06 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2025-05-20 11:18:07 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2025-05-20 11:18:07 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2025-05-20 11:18:07 0 [Note] InnoDB: Setting file '/www/server/data/ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2025-05-20 11:18:07 0 [Note] InnoDB: File '/www/server/data/ibtmp1' size is now 12 MB.
2025-05-20 11:18:07 0 [Note] InnoDB: Waiting for purge to start
2025-05-20 11:18:07 0 [Note] InnoDB: 10.3.31 started; log sequence number 1626042; transaction id 20
2025-05-20 11:18:07 0 [Note] InnoDB: Loading buffer pool(s) from /www/server/data/ib_buffer_pool
2025-05-20 11:18:07 0 [Note] Plugin 'FEEDBACK' is disabled.
2025-05-20 11:18:07 0 [Note] InnoDB: Buffer pool(s) load completed at 250520 11:18:07
2025-05-20 11:18:08 0 [Warning] Failed to create a socket for IPv6 '::': errno: 97.
2025-05-20 11:18:08 0 [Note] Server socket created on IP: '0.0.0.0'.
2025-05-20 11:18:08 0 [Warning] 'user' entry 'root@localhost' has both a password and an authentication plugin specified. The password will be ignored.
2025-05-20 11:18:08 0 [Note] Reading of all Master_info entries succeeded
2025-05-20 11:18:08 0 [Note] Added new Master_info '' to hash table
2025-05-20 11:18:08 0 [Note] /www/server/mysql/bin/mysqld: ready for connections.
Version: '10.3.31-MariaDB-log'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Source distribution
2025-05-20 11:18:08 8 [Warning] Access denied for user 'root'@'localhost' (using password: NO)

发现新版面板安装的mariadb配置文件目录有问题

新版配置文件目录/tmp/mysqld.sock

而实际sock文件目录在/run/mysqld/mysqld.sock

解决方法:

将sock文件目录配置改正即可

找到socket= /tmp/mysqld.sock

新版aapanel、BT面板安装mariadb 10.3后无法新建数据库怎么办 技术 第1张

修正为:socket= /run/mysqld/mysqld.sock

新版aapanel、BT面板安装mariadb 10.3后无法新建数据库怎么办 技术 第2张

然后重启一下mariadb服务即可。

更新:

以上方法有点治标不治本,后来偶然在aapanel官方论坛上看到正解,原因竟然是Debian 11系统自带了Mariadb,然后我们又安装了新Mariadb导致启动混乱

解决方法很简单,把自带Mariadb卸载干净即可。

参照https://www.70ol.com/jishu/286.html

推荐阅读

文章标签:

版权声明: 本文除特别说明外均由原创

本文链接: https://www.70ol.com/jishu/285.html,尊重共享,欢迎转载,请自觉添加本文链接,谢谢!

分享本文: 请填写您的分享代码。

呃 本文暂时没人评论 来添加一个吧

发表评论

必填

选填

选填

必填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。