- 论坛徽章:
- 0
|
不知道为什么在本地执行的PHP脚本连接不了mysql,我检测如下:
mysqladmin -h `hostname` version variables
mysqladmin Ver 8.41 Distrib 4.1.18, for unknown-linux-gnu on armeb
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Server version 4.1.18-log
Protocol version 10
Connection MYNAS via TCP/IP
TCP port 3306
Uptime: 20 min 12 sec
Threads: 2 Questions: 43 Slow queries: 0 Opens: 24 Flush tables: 1 Open tables: 4 Queries per second avg: 0.035
+---------------------------------+----------------------------+
| Variable_name | Value |
+---------------------------------+----------------------------+
| back_log | 50 |
| basedir | /usr/ |
| binlog_cache_size | 32768 |
| bulk_insert_buffer_size | 8388608 |
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /var/mysql/mysql/charsets/ |
| collation_connection | latin1_swedish_ci |
| collation_database | latin1_swedish_ci |
| collation_server | latin1_swedish_ci |
| concurrent_insert | ON |
| connect_timeout | 5 |
| datadir | /var/mysql/ |
| date_format | %Y-%m-%d |
| datetime_format | %Y-%m-%d %H:%i:%s |
| default_week_format | 0 |
| delay_key_write | ON |
| delayed_insert_limit | 100 |
| delayed_insert_timeout | 300 |
| delayed_queue_size | 1000 |
| expire_logs_days | 0 |
| flush | OFF |
| flush_time | 0 |
| ft_boolean_syntax | + -><()~*:""&| |
| ft_max_word_len | 84 |
| ft_min_word_len | 4 |
| ft_query_expansion_limit | 20 |
| ft_stopword_file | (built-in) |
| group_concat_max_len | 1024 |
| have_archive | NO |
| have_bdb | NO |
| have_blackhole_engine | NO |
| have_compress | YES |
| have_crypt | YES |
| have_csv | NO |
| have_example_engine | NO |
| have_geometry | YES |
| have_innodb | NO |
| have_isam | NO |
| have_ndbcluster | NO |
| have_openssl | NO |
| have_query_cache | NO |
| have_raid | NO |
| have_rtree_keys | YES |
| have_symlink | YES |
| init_connect | |
| init_file | |
| init_slave | |
| interactive_timeout | 28800 |
| join_buffer_size | 131072 |
| key_buffer_size | 16384 |
| key_cache_age_threshold | 300 |
| key_cache_block_size | 1024 |
| key_cache_division_limit | 100 |
| language | /var/mysql/mysql/english/ |
| large_files_support | ON |
| license | GPL |
| local_infile | ON |
| locked_in_memory | OFF |
| log | ON |
| log_bin | ON |
| log_error | |
| log_slave_updates | OFF |
| log_slow_queries | OFF |
| log_update | OFF |
| log_warnings | 1 |
| long_query_time | 10 |
| low_priority_updates | OFF |
| lower_case_file_system | OFF |
| lower_case_table_names | 0 |
| max_allowed_packet | 1047552 |
| max_binlog_cache_size | 4294967295 |
| max_binlog_size | 1073741824 |
| max_connect_errors | 10 |
| max_connections | 100 |
| max_delayed_threads | 20 |
| max_error_count | 64 |
| max_heap_table_size | 16777216 |
| max_insert_delayed_threads | 20 |
| max_join_size | 4294967295 |
| max_length_for_sort_data | 1024 |
| max_relay_log_size | 0 |
| max_seeks_for_key | 4294967295 |
| max_sort_length | 1024 |
| max_tmp_tables | 32 |
| max_user_connections | 100 |
| max_write_lock_count | 4294967295 |
| myisam_data_pointer_size | 4 |
| myisam_max_extra_sort_file_size | 2147483648 |
| myisam_max_sort_file_size | 2147483647 |
| myisam_recover_options | OFF |
| myisam_repair_threads | 1 |
| myisam_sort_buffer_size | 8388608 |
| myisam_stats_method | nulls_unequal |
| net_buffer_length | 2048 |
| net_read_timeout | 30 |
| net_retry_count | 10 |
| net_write_timeout | 60 |
| new | OFF |
| old_passwords | OFF |
| open_files_limit | 1024 |
| pid_file | /var/mysql/MYNAS.pid |
| port | 3306 |
| preload_buffer_size | 32768 |
| protocol_version | 10 |
| query_alloc_block_size | 8192 |
| query_prealloc_size | 8192 |
| range_alloc_block_size | 2048 |
| read_buffer_size | 258048 |
| read_only | OFF |
| read_rnd_buffer_size | 258048 |
| relay_log_purge | ON |
| relay_log_space_limit | 0 |
| rpl_recovery_rank | 0 |
| secure_auth | OFF |
| server_id | 1 |
| skip_external_locking | ON |
| skip_networking | OFF |
| skip_show_database | OFF |
| slave_net_timeout | 3600 |
| slave_transaction_retries | 0 |
| slow_launch_time | 2 |
| socket | /tmp/mysql.sock |
| sort_buffer_size | 65528 |
| sql_mode | |
| sql_notes | OFF |
| sql_warnings | OFF |
| storage_engine | MyISAM |
| sync_binlog | 0 |
| sync_frm | ON |
| sync_replication | 0 |
| sync_replication_slave_id | 0 |
| sync_replication_timeout | 0 |
| system_time_zone | UTC |
| table_cache | 4 |
| table_type | MyISAM |
| thread_cache_size | 0 |
| thread_stack | 131072 |
| time_format | %H:%i:%s |
| time_zone | SYSTEM |
| tmp_table_size | 33554432 |
| tmpdir | |
| transaction_alloc_block_size | 8192 |
| transaction_prealloc_size | 4096 |
| tx_isolation | REPEATABLE-READ |
| version | 4.1.18-log |
| version_comment | Source distribution |
| version_compile_machine | armeb |
| version_compile_os | unknown-linux-gnu |
| wait_timeout | 28800 |
+---------------------------------+----------------------------+
mysqladmin --protocol=socket --socket=/tmp/mysql.sock version
mysqladmin Ver 8.41 Distrib 4.1.18, for unknown-linux-gnu on armeb
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license
Server version 4.1.18-log
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 25 min 42 sec
Threads: 2 Questions: 46 Slow queries: 0 Opens: 24 Flush tables: 1 Open tables: 4 Queries per second avg: 0.030
netstat -ln | grep mysql
unix 2 [ ACC ] STREAM LISTENING 1204 /tmp/mysql.sock
mysql log纪录:
060910 22:25:47 mysqld started
/usr/libexec/mysqld: ready for connections.
Version: '4.1.18-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
telnet MYNAS 3306
8
4.1.18-logRg0XID[},&?MCFvB$+M#d
Connection closed by foreign host.
ps ::
1410 root 636 S /bin/sh /usr/bin/mysqld_safe --datadir=/var/mysql --pid-file=/var/mysql/MYNAS.pid
1485 mysql 2780 S /usr/libexec/mysqld --basedir=/usr --datadir=/var/mysql --user=mysql --pid-file=/var/mysql/
1486 mysql 2780 S /usr/libexec/mysqld --basedir=/usr --datadir=/var/mysql --user=mysql --pid-file=/var/mysql/
1487 mysql 2780 S /usr/libexec/mysqld --basedir=/usr --datadir=/var/mysql --user=mysql --pid-file=/var/mysql/
php -v ::
PHP 4.4.3 (cgi-fcgi) (built: Aug 6 2006 02:11:47)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with eAccelerator v0.9.5-rc1, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
PHP.ini ::
- [MySQL]
- mysql.allow_persistent = On
- mysql.max_persistent = -1
- mysql.max_links = -1
- mysql.default_port =
- mysql.default_socket =
- mysql.default_host =
- mysql.default_user =
- mysql.default_password =
- mysql.connect_timeout = 60
- mysql.trace_mode = Off
复制代码
PHP 4.4.3 Configure Command ::
- './configure' '--with-mysql' '--enable-force-redirect' '--enable-fastcgi' '--with-gd' '--with-png' '--with-zlib' '--with-jpeg' '--enable-exif' '--with-freetype-dir=/usr/local/include/freetype2/freetype' '--enable-ftp'
复制代码
mysqladmin --version
- mysqladmin Ver 8.41 Distrib 4.1.18, for unknown-linux-gnu on armeb
复制代码 |
|