Can't connect to MySQL server on 'xxx' (13)

解决方法1、:setsebool -P httpd_can_network_connect_db=1

解决方法2、:修改/etc/selinux/config SELINUX=enforcing 为 SELINUX=disabled

展开阅读全文

(急)Can't connect to MySQL server on 'localhost' (10061)

03-07

看了很多解答,多数是因为数据库服务没有启动,我确定我的MySQL服务是启动了的,不知道这个问题和数据库的版本有关系吗?rnrn错误提示:rnWarning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in D:\MYOA\webroot\liuyanban\index.php on line 2rnrnWarning: mysql_select_db() [function.mysql-select-db]: Access denied for user: 'ODBC@localhost' (Using password: NO) in D:\MYOA\webroot\liuyanban\index.php on line 3rnrnWarning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in D:\MYOA\webroot\liuyanban\index.php on line 3rnrnWarning: mysql_query() [function.mysql-query]: Access denied for user: 'ODBC@localhost' (Using password: NO) in D:\MYOA\webroot\liuyanban\index.php on line 4rnrnWarning: mysql_query() [function.mysql-query]: A link to the server could not be established in D:\MYOA\webroot\liuyanban\index.php on line 4rnrnWarning: mysql_query() [function.mysql-query]: Access denied for user: 'ODBC@localhost' (Using password: NO) in D:\MYOA\webroot\liuyanban\index.php on line 6rnrnWarning: mysql_query() [function.mysql-query]: A link to the server could not be established in D:\MYOA\webroot\liuyanban\index.php on line 6rnrnWarning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in D:\MYOA\webroot\liuyanban\index.php on line 7rnrn初学PHP,请高手帮忙解答!rn 论坛

频繁出现Can't connect to MySQL server on 'localhost' (10061)

04-20

我的数据库连接代码是rnpublic function open()rn rn $db = new Data_Mysql();rn return $db;rn rn rn function __construct($pconnect = 0)rn rn try rn rn $func = $pconnect==0 ? 'mysql_connect' : 'mysql_pconnect';rn rn $this->link = @$func($this->dbhost, $this->dbuser, $this->dbpw, 1);rn rn $charset1 = $this->dbcharset == '' ? $this->charset : "GB2312";rn rn if(!empty($charset1))rn rn if(function_exists('mysql_set_charset'))rn rn @mysql_set_charset($charset1, $this->link);rn rn else rn rn $collation_query = "SET NAMES '$charset1'";rn $this->Query($collation_query);rn rn rn rn $this->dbname && @mysql_select_db($this->dbname, $this->link);rn rn catch (Exception $e) rn rn if ($this->errno())rn rn throw new Common_MyException("Can't connect to database./数据库服务器连接失败 ");rn rn rn rn rn rn function Query($sql)//执行代码rn rn tryrn rn if(!($result = @mysql_query($sql, $this->link)))rn rn throw new Common_MyException($this->error());rn rn rn catch (Common_MyException $e)rn rn die($e->showStackTrace());rn rn return $result;rn rn rn rn function __destruct()//断开连接rn rn if (!$this->errno())rn rn $this->close();rn rn rn //释放结果集所占用的内存rn function free_result($query) rn return mysql_free_result($query);rn rn rn //返回多条记录rn public function FetchAll($sql)rn rn $returnRows=array();rn tryrn rn if($sql==null) rn rn throw new MyException("查询语句为空."); rn rn if(!($result = $this->Query($sql)))rn rn throw new Common_MyException($this->error());rn rn while ($rows=$this->fetch_array($result)) rn rn $returnRows[]=$rows;rn rn return $returnRows;rn rn rn catch (Common_MyException $e)rn rn die($e->showStackTrace());rn rn rn rn function FetchRow($sql)//返回单条记录rn rn $rows=null;rn rn tryrn rn if($sql==null || $sql=="") rn throw new MyException("查询语句为空.");rn rn rn if(!($result = $this->Query($sql)))rn rn throw new Common_MyException($this->error());rn rn $rows = $this->fetch_array($result);rn rn rn catch (Common_MyException $e)rn rn die($e->showStackTrace());rn rn return $rows;rn rn rn function error() rn return (($this->link) ? mysql_error($this->link) : mysql_error());rn rn rn function errno() rn return intval(($this->link) ? mysql_errno($this->link) : mysql_errno());rn rn rn function select_db($dbname) rn return mysql_select_db($dbname, $this->link);rn rn rn function close() rn return mysql_close($this->link);rn rn rn function num_rows($query) rn $query = mysql_num_rows($query);rn return $query;rn rn rn function result($query, $row = 0) rn $query = @mysql_result($query, $row);rn return $query;rn rn rn function insert_id() rn return ($id = mysql_insert_id($this->link)) >= 0 ? $id : $this->result($this->query("SELECT last_insert_id()"), 0);rn rn rn function fetch_array($query, $result_type = MYSQL_ASSOC) rn return mysql_fetch_array($query, $result_type);rn rnrn可是网站都是频繁报错rnWarning: mysql_set_charset() expects parameter 2 to be resource, boolean given in D:\webSite\wwwz2gcomcn\Inc\Data\Mysql.php on line 37rnrnWarning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\webSite\wwwz2gcomcn\Inc\Data\Mysql.php on line 62rn或者rnWarning: mysql_close(): supplied argument is not a valid MySQL-Link resource in D:\webSite\wwwz2gcomcn\Inc\Data\Mysql.php on line 151rn哪位高手能帮我解决下呀,小弟在这不胜感激rn 论坛

MySAL: Can't connect to MySQL server on 'localhost' (10061)

09-03

[b]MySQL版本[/b]:mysql-5.7.4-m14-winx64rn[b]MySQL路径[/b]:D:/mysql/mysql-5.7.4-m14-winx64rn[b]电脑系统[/b]:windows7 旗舰版 sp1 64位系统rnrn[b]my.ini文件配置如下[/b]:rn [color=#333399][client]rn default-character-set=utf8rn rn [mysqld]rn port=3306rn basedir ="D:/mysql/mysql-5.7.4-m14-winx64/"rn datadir ="D:/mysql/mysql-5.7.4-m14-winx64/data/"rn tmpdir ="D:/mysql/mysql-5.7.4-m14-winx64/data/"rn socket ="D:/mysql/mysql-5.7.4-m14-winx64/data/mysql.sock"rn log-error="D:/mysql/mysql-5.7.4-m14-winx64/data/mysql_error.log"rn max_connections=100rn table_open_cache=256rn query_cache_size=1M rn tmp_table_size=32Mrn thread_cache_size=8rn innodb_data_home_dir="D:/mysql/mysql-5.7.4-m14-winx64/data/"rn innodb_flush_log_at_trx_commit =1rn innodb_log_buffer_size=128Mrn innodb_buffer_pool_size=128Mrn innodb_log_file_size=10Mrn innodb_thread_concurrency=16rn innodb-autoextend-increment=1000rn join_buffer_size = 128Mrn sort_buffer_size = 32Mrn read_rnd_buffer_size = 32Mrn max_allowed_packet = 32Mrn explicit_defaults_for_timestamp=truern sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"rn #sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES[/color]rnrn在DOS窗口下,输入net start mysql,MySQL服务正常启动。rn通过命令:rn[color=#FF0000]mysql -uroot -p123456[/color] 或者[color=#FF0000]mysql -uroot -p123456 -hlocalhost[/color]rn能够登陆进mysql,并且执行一般的增删改查功能都正常,执行show processlist;结果如下:rn+----+------+----------------+------+---------+------+----------+------------------+rn| Id | User | Host | db | Command | Time | State | Info |rn+----+------+----------------+------+---------+------+----------+------------------+rn| 1 | root | localhost:3707 | NULL | Query | 0 | starting | show processlist |rn+----+------+----------------+------+---------+------+----------+------------------+rn不知道为什么这里会是3707rnrn但是执行命令:[color=#FF0000]mysql -uroot -p123456 -h127.0.0.1[/color]会报错rn错误消息为:ERROR 2004 (HY000): Can't create TCP/IP socket (87)rnhosts文件里面没有设置127.0.0.1 localhost(试过了,事实证明根本没用)rnrnrn有人说是3306端口被占用,我netstat -nao查了一下PID,在任务管理器里面对比,确认是mysqld.exe在用3306,没有其rn他程序占用此端口rn有人说是防火墙的原因,需要把防火墙关了,看了一下我防火墙是关闭的rn有人说是max_connections设置得太小,我设置成1000然后用工具连接mysql依旧报10061错。rn有人说是需要执行授权操作,需要执行命令:[color=#FF0000]GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' rnrnIDENTIFIED BY '123456' WITH GRANT OPTION;[/color](我也试过了,事实证明,没用)rn有人说是因为 my.ini 文件 [mysqld] 项里面没有设置bind-address=127.0.0.1的原因,我也试了,试试证明,如果我rn设置了这个,mysql服务都启动不鸟,又有人说设置成bind-address=0.0.0.0,结果一样的,mysql服务都无法启动,然rnrn后我在又试了一下设置bind-address=192.168.1.101(本机IP),依旧是无法启动mysql。rnrn然后,我试着在DOS下执行:rn[color=#FF0000]mysqladmin -uroot -p123456 version[/color]rn或者rn[color=#FF0000]mysqladmin -uroot -p123456 -hlocalhost version[/color]rn提示错误:rnmysqladmin: [Warning] Using a password on the command line interface can be insecure.rnmysqladmin: connect to server at 'localhost' failedrnerror: 'Unknown MySQL server host 'localhost' (2)'rnCheck that mysqld is running on localhost and that the port is 3306.rnYou can check this by doing 'telnet localhost 3306'rnrn执行:[color=#FF0000]mysqladmin -uroot -p123456 -h127.0.0.1 version[/color]rn提示错误:rnmysqladmin: [Warning] Using a password on the command line interface can be insecure.rnmysqladmin: connect to server at '127.0.0.1' failedrnerror: 'Can't create TCP/IP socket (87)'rnrn期间也试着在hosts里面添加127.0.0.1 localhost然后再执行上面的命令,事实证明,跟这个无关。rnrnrn另外,我试着在DOS里面执行 [color=#FF0000]telnet 127.0.0.1 3306[/color],提示无法打开到主机的连接rn但是,我执行 [color=#FF0000]telnet localhost 3306[/color],能够连进去(这里我也是过在hosts文件里面添加rn127.0.0.1 localhost,事实证明跟这个也没关系)rnrnrn求大神解答,该怎么解决 论坛

间断性出现Can not connect to MySQL server

08-08

向各位高手求教:rnrnIIS+php+mysql。rnIIS为win2003,mysql为AS4,在一个千兆局域网内。rnrnmy.cnf:rn[mysqld]rnport = 3306rnsocket = /tmp/mysql.sockrnskip-lockingrnskip-name-resolvernkey_buffer = 700Mrnmax_allowed_packet = 4Mrntable_cache = 1536rn#sort_buffer_size = 16Mrnsort_buffer_size = 32Mrnnet_buffer_length =2Mrnread_buffer_size = 4Mrnread_rnd_buffer_size = 4Mrnmyisam_sort_buffer_size = 64Mrnmax_connections=1000rnquery_cache_size=128Mrnthread_cache_size=400rntmp_table_size = 128Mrnwait_timeout=10rnrnshow status:rn 2868 rn 29 rn 0 rn 0 rnrn| Aborted_clients | 2868 |rn| Aborted_connects | 29 |rn| Binlog_cache_disk_use | 0 |rn| Binlog_cache_use | 0 |rn| Bytes_received | 192 |rn| Bytes_sent | 13361 |rn| Com_admin_commands | 0 |rn.rn.rn.rn| Com_select | 1 |rn| Com_set_option | 0 |rn| Com_show_status | 5 |rn| Compression | OFF |rn.rn.rn.rn| Connections | 1177715 |rn| Created_tmp_disk_tables | 0 |rn| Created_tmp_files | 767 |rn| Created_tmp_tables | 3 |rn| Delayed_errors | 0 |rn| Delayed_insert_threads | 0 |rn| Delayed_writes | 0 |rn| Flush_commands | 1 |rn.rn.rn.rn| Handler_read_rnd_next | 508 |rn| Handler_rollback | 0 |rn| Handler_savepoint | 0 |rn| Handler_savepoint_rollback | 0 |rn| Handler_update | 0 |rn| Handler_write | 638 |rn| Innodb_buffer_pool_pages_data | 19 |rn| Innodb_buffer_pool_pages_dirty | 0 |rn| Innodb_buffer_pool_pages_flushed | 0 |rn| Innodb_buffer_pool_pages_free | 493 |rn| Innodb_buffer_pool_pages_latched | 0 |rn| Innodb_buffer_pool_pages_misc | 0 |rn| Innodb_buffer_pool_pages_total | 512 |rn| Innodb_buffer_pool_read_ahead_rnd | 1 |rn| Innodb_buffer_pool_read_ahead_seq | 0 |rn| Innodb_buffer_pool_read_requests | 77 |rn| Innodb_buffer_pool_reads | 12 |rn| Innodb_buffer_pool_wait_free | 0 |rn| Innodb_buffer_pool_write_requests | 0 |rn| Innodb_data_fsyncs | 3 |rn| Innodb_data_pending_fsyncs | 0 |rn| Innodb_data_pending_reads | 0 |rn| Innodb_data_pending_writes | 0 |rn| Innodb_data_read | 2494464 |rn| Innodb_data_reads | 25 |rn| Innodb_data_writes | 3 |rn| Innodb_data_written | 1536 |rn| Innodb_dblwr_pages_written | 0 |rn| Innodb_dblwr_writes | 0 |rn| Innodb_log_waits | 0 |rn| Innodb_log_write_requests | 0 |rn| Innodb_log_writes | 1 |rn| Innodb_os_log_fsyncs | 3 |rn| Innodb_os_log_pending_fsyncs | 0 |rn| Innodb_os_log_pending_writes | 0 |rn| Innodb_os_log_written | 512 |rn| Innodb_page_size | 16384 |rn| Innodb_pages_created | 0 |rn| Innodb_pages_read | 19 |rn| Innodb_pages_written | 0 |rn| Innodb_row_lock_current_waits | 0 |rn| Innodb_row_lock_time | 0 |rn| Innodb_row_lock_time_avg | 0 |rn| Innodb_row_lock_time_max | 0 |rn| Innodb_row_lock_waits | 0 |rn| Innodb_rows_deleted | 0 |rn| Innodb_rows_inserted | 0 |rn| Innodb_rows_read | 0 |rn| Innodb_rows_updated | 0 |rn| Key_blocks_not_flushed | 0 |rn| Key_blocks_unused | 402625 |rn| Key_blocks_used | 233053 |rn| Key_read_requests | 217142621 |rn| Key_reads | 240786 |rn| Key_write_requests | 745593 |rn| Key_writes | 730218 |rn| Last_query_cost | 0.000000 |rn| Max_used_connections | 269 |rn| Ndb_cluster_node_id | 0 |rn| Ndb_config_from_host | |rn| Ndb_config_from_port | 0 |rn| Ndb_number_of_data_nodes | 0 |rn| Not_flushed_delayed_rows | 0 |rn| Open_files | 1717 |rn| Open_streams | 0 |rn| Open_tables | 1536 |rn| Opened_tables | 0 |rn| Prepared_stmt_count | 0 |rn| Qcache_free_blocks | 10830 |rn| Qcache_free_memory | 111468376 |rn| Qcache_hits | 2042098 |rn| Qcache_inserts | 2912582 |rn| Qcache_lowmem_prunes | 0 |rn| Qcache_not_cached | 193594 |rn| Qcache_queries_in_cache | 16671 |rn| Qcache_total_blocks | 44305 |rn| Questions | 10613361 |rn| Rpl_status | NULL |rn| Select_full_join | 0 |rn| Select_full_range_join | 0 |rn| Select_range | 0 |rn| Select_range_check | 0 |rn| Select_scan | 3 |rn| Slave_open_temp_tables | 0 |rn| Slave_retried_transactions | 0 |rn| Slave_running | OFF |rn.rn.rn.rn| Ssl_session_cache_mode | NONE |rn| Ssl_session_cache_overflows | 0 |rn| Ssl_session_cache_size | 0 |rn| Ssl_session_cache_timeouts | 0 |rn| Ssl_sessions_reused | 0 |rn| Ssl_used_session_cache_entries | 0 |rn| Ssl_verify_depth | 0 |rn| Ssl_verify_mode | 0 |rn| Ssl_version | |rn| Table_locks_immediate | 7248667 |rn| Table_locks_waited | 81875 |rn| Tc_log_max_pages_used | 0 |rn| Tc_log_page_size | 0 |rn| Tc_log_page_waits | 0 |rn| Threads_cached | 260 |rn| Threads_connected | 9 |rn| Threads_created | 269 |rn| Threads_running | 2 |rn| Uptime | 54230 |rn| Uptime_since_flush_status | 54230 |rn+-----------------------------------+-----------+rnrnrnrn 论坛

Can not connect to MySQL server 解决不了了 求助

11-06

之前服务器出现这种情况的时候,我只要重启服务器就可以了。今天不行了。rn以前没用过 别人安装的。请大家帮忙看一下。rn下面是我的my.inirn# MySQL Server Instance Configuration Filern# ----------------------------------------------------------------------rn# Generated by the MySQL Server Instance Configuration Wizardrn#rn#rn# Installation Instructionsrn# ----------------------------------------------------------------------rn#rn# On Linux you can copy this file to /etc/my.cnf to set global options,rn# mysql-data-dir/my.cnf to set server-specific optionsrn# (@localstatedir@ for this installation) or torn# ~/.my.cnf to set user-specific options.rn#rn# On Windows you should keep this file in the installation directory rn# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). Torn# make sure the server reads the config file use the startup option rn# "--defaults-file". rn#rn# To run run the server from the command line, execute this in a rn# command line shell, e.g.rn# mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"rn#rn# To install the server as a Windows service manually, execute this in a rn# command line shell, e.g.rn# mysqld --install MySQLXY --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"rn#rn# And then execute this in a command line shell to start the server, e.g.rn# net start MySQLXYrn#rn#rn# Guildlines for editing this filern# ----------------------------------------------------------------------rn#rn# In this file, you can use all long options that the program supports.rn# If you want to know the options a program supports, start the programrn# with the "--help" option.rn#rn# More detailed information about the individual options can also bern# found in the manual.rn#rn#rn# CLIENT SECTIONrn# ----------------------------------------------------------------------rn#rn# The following options will be read by MySQL client applications.rn# Note that only client applications shipped by MySQL are guaranteedrn# to read this section. If you want your own MySQL client program torn# honor these values, you need to specify it as an option during thern# MySQL client library initialization.rn#rn[client]rnrnport=3306rnrn[mysql]rnrndefault-character-set=utf8rnrnrn# SERVER SECTIONrn# ----------------------------------------------------------------------rn#rn# The following options will be read by the MySQL Server. Make sure thatrn# you have installed the server correctly (see above) so it reads this rn# file.rn#rn[mysqld]rnrn# The TCP/IP Port the MySQL Server will listen onrnport=6033rnrnrn#Path to installation directory. All paths are usually resolved relative to this.rnbasedir="D:/AMPZ/MySQL/"rnrn#Path to the database rootrndatadir="F:/Data/"rnrn# The default character set that will be used when a new schema or table isrn# created and no character set is definedrndefault-character-set=utf8rnrn# The default storage engine that will be used when create new tables whenrndefault-storage-engine=INNODBrnrn# Set the SQL mode to strictrnsql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"rnrn# The maximum amount of concurrent sessions the MySQL server willrn# allow. One of these connections will be reserved for a user withrn# SUPER privileges to allow the administrator to login even if thern# connection limit has been reached.rnmax_connections=1024[color=#FF0000](此处数值我改过,杯具的上我忘了改之前的数了)[/color]rnrn# Query cache is used to cache SELECT results and later return themrn# without actual executing the same query once again. Having the queryrn# cache enabled may result in significant speed improvements, if yourrn# have a lot of identical queries and rarely changing tables. See thern# "Qcache_lowmem_prunes" status variable to check if the current valuern# is high enough for your load.rn# Note: In case your tables change very often or if your queries arern# textually different every time, the query cache may result in arn# slowdown instead of a performance improvement.rnquery_cache_size=45Mrnrn# The number of open tables for all threads. Increasing this valuern# increases the number of file descriptors that mysqld requires.rn# Therefore you have to make sure to set the amount of open filesrn# allowed to at least 4096 in the variable "open-files-limit" inrn# section [mysqld_safe]rntable_cache=64[color=#FF0000](此处数值我改过,杯具的上我忘了改之前的数了)[/color]rnrn# Maximum size for internal (in-memory) temporary tables. If a tablern# grows larger than this value, it is automatically converted to diskrn# based table This limitation is for a single table. There can be manyrn# of them.rntmp_table_size=16Mrnrnrn# How many threads we should keep in a cache for reuse. When a clientrn# disconnects, the client's threads are put in the cache if there aren'trn# more than thread_cache_size threads from before. This greatly reducesrn# the amount of thread creations needed if you have a lot of newrn# connections. (Normally this doesn't give a notable performancern# improvement if you have a good thread implementation.)rnthread_cache_size=38rnrn#*** MyISAM Specific optionsrnrn# The maximum size of the temporary file MySQL is allowed to use whilern# recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.rn# If the file-size would be bigger than this, the index will be createdrn# through the key cache (which is slower).rnmyisam_max_sort_file_size=100Grnrn# If the temporary file used for fast index creation would be biggerrn# than using the key cache by the amount specified here, then prefer thern# key cache method. This is mainly used to force long character keys inrn# large tables to use the slower key cache method to create the index.rnmyisam_sort_buffer_size=16Mrnrn# Size of the Key Buffer, used to cache index blocks for MyISAM tables.rn# Do not set it larger than 30% of your available memory, as some memoryrn# is also required by the OS to cache rows. Even if you're not usingrn# MyISAM tables, you should still set it to 8-64M as it will also bern# used for internal temporary disk tables.rnkey_buffer_size=68Mrnrn# Size of the buffer used for doing full table scans of MyISAM tables.rn# Allocated per thread, if a full scan is needed.rnread_buffer_size=64Krnread_rnd_buffer_size=256Krnrn# This buffer is allocated when MySQL needs to rebuild the index inrn# REPAIR, OPTIMZE, ALTER table statements as well as in LOAD DATA INFILErn# into an empty table. It is allocated per thread so be careful withrn# large settings.rnsort_buffer_size=256Krnrnrn#*** INNODB Specific options ***rninnodb_data_home_dir="F:/Data/"rnrn# Use this option if you have a MySQL server with InnoDB support enabledrn# but you do not plan to use it. This will save memory and disk spacern# and speed up some things.rn#skip-innodbrnrn# Additional memory pool that is used by InnoDB to store metadatarn# information. If InnoDB requires more memory for this purpose it willrn# start to allocate it from the OS. As this is fast enough on mostrn# recent operating systems, you normally do not need to change thisrn# value. SHOW INNODB STATUS will display the current amount used.rninnodb_additional_mem_pool_size=3Mrnrn# If set to 1, InnoDB will flush (fsync) the transaction logs to thern# disk at each commit, which offers full ACID behavior. If you arern# willing to compromise this safety, and you are running smallrn# transactions, you may set this to 0 or 2 to reduce disk I/O to thern# logs. Value 0 means that the log is only written to the log file andrn# the log file flushed to disk approximately once per second. Value 2rn# means the log is written to the log file at each commit, but the logrn# file is only flushed to disk approximately once per second.rninnodb_flush_log_at_trx_commit=1rnrn# The size of the buffer InnoDB uses for buffering log data. As soon asrn# it is full, InnoDB will have to flush it to disk. As it is flushedrn# once per second anyway, it does not make sense to have it very largern# (even with long transactions).rninnodb_log_buffer_size=1347Krnrn# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes andrn# row data. The bigger you set this the less disk I/O is needed torn# access data in tables. On a dedicated database server you may set thisrn# parameter up to 80% of the machine physical memory size. Do not set itrn# too large, though, because competition of the physical memory mayrn# cause paging in the operating system. Note that on 32bit systems yourn# might be limited to 2-3.5G of user level memory per process, so do notrn# set it too high.rninnodb_buffer_pool_size=131Mrnrn# Size of each log file in a log group. You should set the combined sizern# of log files to about 25%-100% of your buffer pool size to avoidrn# unneeded buffer pool flush activity on log file overwrite. However,rn# note that a larger logfile size will increase the time needed for thern# recovery process.rninnodb_log_file_size=27Mrnrn# Number of threads allowed inside the InnoDB kernel. The optimal valuern# depends highly on the application, hardware as well as the OSrn# scheduler properties. A too high value may lead to thread thrashing.rninnodb_thread_concurrency=8rn 论坛

没有更多推荐了,返回首页