gpt4 book ai didi

php - 尝试使用 PHP 连接时获取 mysql "connection refused"

转载 作者:行者123 更新时间:2023-11-30 23:16:45 26 4
gpt4 key购买 nike

这是我的 mariadb 日志的输出:

$ sudo tail -f /opt/local/var/db/mariadb/rs012esb.mckenna.edu.err 130626 9:10:56 [ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure 130626 9:10:56 [ERROR] mysqld: Can't find file: './performance_schema/rwlock_instances.frm' (errno: 13) 130626 9:10:56 [ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure 130626 9:10:56 [ERROR] mysqld: Can't find file: './performance_schema/cond_instances.frm' (errno: 13) 130626 9:10:56 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure 130626 9:10:56 [ERROR] mysqld: Can't find file: './performance_schema/file_instances.frm' (errno: 13) 130626 9:10:56 [ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure 130626 9:10:56 [Note] Event Scheduler: Loaded 0 events 130626 9:10:56 [Note] /opt/local/lib/mariadb/bin/mysqld: ready for connections. Version: '5.5.31-MariaDB' socket: '/opt/local/var/run/mariadb/mysqld.sock' port: 0 Source distribution 130626 9:14:04 [Note] /opt/local/lib/mariadb/bin/mysqld: Normal shutdown

130626 9:14:04 [Note] Event Scheduler: Purging the queue. 0 events 130626 9:14:04 InnoDB: Starting shutdown... 130626 9:14:04 InnoDB: Shutdown completed; log sequence number 10740580 130626 9:14:04 [Note] /opt/local/lib/mariadb/bin/mysqld: Shutdown complete

130626 09:14:04 mysqld_safe mysqld from pid file /opt/local/var/db/mariadb/rs012esb.mckenna.edu.pid ended 130626 09:14:25 mysqld_safe Starting mysqld daemon with databases from /opt/local/var/db/mariadb 130626 9:14:25 [Warning] Setting lower_case_table_names=2 because file system for /opt/local/var/db/mariadb/ is case insensitive 130626 9:14:25 InnoDB: The InnoDB memory heap is disabled 130626 9:14:25 InnoDB: Mutexes and rw_locks use GCC atomic builtins 130626 9:14:25 InnoDB: Compressed tables use zlib 1.2.8 130626 9:14:25 InnoDB: Initializing buffer pool, size = 128.0M 130626 9:14:25 InnoDB: Completed initialization of buffer pool 130626 9:14:25 InnoDB: highest supported file format is Barracuda. 130626 9:14:25 InnoDB: Waiting for the background threads to start 130626 9:14:26 Percona XtraDB (http://www.percona.com) 5.5.31-MariaDB-30.2 started; log sequence number 10740580 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/events_waits_current.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/events_waits_history.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/events_waits_history_long.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/setup_consumers.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/setup_instruments.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/setup_timers.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/performance_timers.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/threads.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'threads' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/events_waits_summary_by_thread_by_event_name.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/events_waits_summary_by_instance.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/events_waits_summary_global_by_event_name.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/file_summary_by_event_name.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/file_summary_by_instance.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/mutex_instances.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/rwlock_instances.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/cond_instances.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure 130626 9:14:26 [ERROR] mysqld: Can't find file: './performance_schema/file_instances.frm' (errno: 13) 130626 9:14:26 [ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure 130626 9:14:26 [Note] Event Scheduler: Loaded 0 events 130626 9:14:26 [Note] /opt/local/lib/mariadb/bin/mysqld: ready for connections. Version: '5.5.31-MariaDB' socket: '/opt/local/var/run/mariadb/mysqld.sock' port: 0 Source distribution

mysql 通过 PHP 报告:连接被 mysql_error() 调用拒绝。这已经工作了几个月。然后,今天早上,启动我的本地主机 mysql,没有任何效果。

编辑:权限似乎很好:

# ls -l /opt/local/var/db/mariadb/performance_schema
total 416
-rw-rw---- 1 root _mysql 8624 Feb 7 14:01 cond_instances.frm
-rw-rw---- 1 root _mysql 61 Feb 7 14:01 db.opt
-rw-rw---- 1 root _mysql 9220 Feb 7 14:01 events_waits_current.frm
-rw-rw---- 1 root _mysql 9220 Feb 7 14:01 events_waits_history.frm
-rw-rw---- 1 root _mysql 9220 Feb 7 14:01 events_waits_history_long.frm
-rw-rw---- 1 root _mysql 8878 Feb 7 14:01 events_waits_summary_by_instance.frm
-rw-rw---- 1 root _mysql 8854 Feb 7 14:01 events_waits_summary_by_thread_by_event_name.frm
-rw-rw---- 1 root _mysql 8814 Feb 7 14:01 events_waits_summary_global_by_event_name.frm
-rw-rw---- 1 root _mysql 8654 Feb 7 14:01 file_instances.frm
-rw-rw---- 1 root _mysql 8800 Feb 7 14:01 file_summary_by_event_name.frm
-rw-rw---- 1 root _mysql 8840 Feb 7 14:01 file_summary_by_instance.frm
-rw-rw---- 1 root _mysql 8684 Feb 7 14:01 mutex_instances.frm
-rw-rw---- 1 root _mysql 8776 Feb 7 14:01 performance_timers.frm
-rw-rw---- 1 root _mysql 8758 Feb 7 14:01 rwlock_instances.frm
-rw-rw---- 1 root _mysql 8605 Feb 7 14:01 setup_consumers.frm
-rw-rw---- 1 root _mysql 8637 Feb 7 14:01 setup_instruments.frm
-rw-rw---- 1 root _mysql 8650 Feb 7 14:01 setup_timers.frm
-rw-rw---- 1 root _mysql 8650 Feb 7 14:01 threads.frm

想法?

最佳答案

[ERROR] mysqld: Can't find file: './performance_schema/rwlock_instances.frm' (errno: 13)

检查文件所有者和访问权限。错误 13 通常是“权限被拒绝”。

关于php - 尝试使用 PHP 连接时获取 mysql "connection refused",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17325498/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com