大网数据广告活动
服务器运维问答

MariaDB: Host '127.0.0.1' not privileged

· 52CE 我爱测

My Ghost instance want to conntect to my MariaDB, but the error is: Message: 'ER_HOST_NOT_PRIVILEGED: Host '127.0.0.1' is not allowed to connect to this MariaDB server' Here my my.cnf: [server] skip-name-resolve innodb_buffer_poo…

问题原文

原帖链接 · gummipunkt · CC BY-SA 3.0

My Ghost instance want to conntect to my MariaDB, but the error is:

Message: 'ER_HOST_NOT_PRIVILEGED: Host '127.0.0.1' is not allowed to connect to this MariaDB server'

Here my my.cnf:

[server]
skip-name-resolve
innodb_buffer_pool_size = 128M
innodb_buffer_pool_instances = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 32M
innodb_max_dirty_pages_pct = 90
query_cache_type = 1
query_cache_limit = 2M
query_cache_min_res_unit = 2k
query_cache_size = 64M
tmp_table_size= 64M
max_heap_table_size= 64M
slow-query-log = 1
slow-query-log-file = /var/log/mysql/slow.log
long_query_time = 1
bind-address = 127.0.0.1

[client-server]
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/

[client]
default-character-set = utf8mb4

[mysqld]
character-set-server = utf8mb4
collation-server = utf8mb4_general_ci
binlog_format = MIXED
innodb_large_prefix=on
innodb_file_format=barracuda
innodb_file_per_table=1

社区高分解答

原帖链接 · Michael Hampton · CC BY-SA 3.0

I suspect that your problem is that you've set skip-name-resolve.

By default, the MySQL/MariaDB user database contains only entries that allow access from localhost. But if you skip name resolution, then MySQL doesn't translate your connection from 127.0.0.1 to localhost, and thus can't match your connection to any host that's allowed to connect.

Remove skip-name-resolve and try again.

If you really want to keep this option, you'll need to create MySQL users who can connect from ::1 (and 127.0.0.1 if you still use IPv4) while skip-name-resolve is disabled, and then re-enable it.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-03-10)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。