Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com... Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com... MySQL Configuration Directives --r
Trang 1356 Appendix B • MySQL Configuration Directives
max-binlog-dump-events=# Option used by mysql-test for debugging and testing of replication.
max_binlog_size=# Binary log will be rotated automatically when the size exceeds this value Will also apply to relay logs if max_relay_log_size is 0 The minimum value for this variable is 4096.
max_connect_errors=# If there is more than this number of interrupted connections from a host, this host will be blocked from further connections.
max_connections=# The number of simultaneous clients allowed.
max_delayed_threads=# Don’t start more than this number of threads to handle INSERT DELAYED statements If set to zero, this means INSERT DELAYED is not used.
max_error_count=# The maximum number of errors/warnings to store for a statement.
max_heap_table_size=# Don’t allow creation of heap tables bigger than this.
max_join_size=# Joins that are probably going to read more than max_join_size
records return an error.
max_length_for_sort_data=# The maximum number of bytes in sorted records.
max_relay_log_size=# If this is a nonzero value, the relay log will be rotated cally when the size exceeds this value If this value is zero (the default), when the size exceeds
automati-max_binlog_size it will be rotated The minimum value for this variable is 4096.
max_seeks_for_key=# Limit assumed maximum number of seeks when looking up rows based on a key.
max_sort_length=# The number of bytes to use when sorting BLOB or TEXT values (Only the first max_sort_length bytes of each value are used; the rest are ignored.)
max_tmp_tables=# The maximum number of temporary tables a client can keep open at
memlock Lock mysqld in memory.
myisam_block_size=# The block size to be used for MyISAM index pages.
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 2MySQL Configuration Directives
myisam_max_extra_sort_file_size=# Used to help MySQL decide when to use the slow but safe key cache index creation method.
myisam_max_sort_file_size=# Don’t use the fast sort index method to create an index
if the temporary file would get bigger than this.
myisam-recover=name Syntax: myisam-recover[=option[,option ]], where option
can be DEFAULT, BACKUP, FORCE, or QUICK.
myisam_repair_threads=# The number of threads to use when repairing MyISAM tables The value of 1 disables parallel repair.
myisam_sort_buffer_size=# The buffer that is allocated during index sorting when forming a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.
per -net_buffer_length=# The buffer length for TCP/IP and socket communication.
net_read_timeout=# The number of seconds to wait for more data from a connection before aborting the read.
net_retry_count=# If a read on a communication port is interrupted, retry this many times before giving up.
net_write_timeout=# The number of seconds to wait for a block to be written to a
vconnection before aborting the write.
new Use very new, possibly unsafe functions.
old-passwords Use old password encryption method (needed for 4.0 and older clients).
old-rpl-compat Use old LOAD DATA format in the binary log (don’t save data in file).
open_files_limit=# If this is not 0, mysqld will use this value to reserve file descriptors
to use with setrlimit() If this value is 0, mysqld will reserve the max_connections*5 or
max_connections + table_cache*2 number of files (whichever is larger).
pid-file=name The PID file used by safe_mysqld.
port=# The port number to use for the connection.
preload_buffer_size=# The size of the buffer that is allocated when preloading indexes.
query_alloc_block_size=# The allocation block size for query parsing and execution.
query_cache_limit=# Don’t cache results that are bigger than this.
query_cache_min_res_unit=# The minimal size of unit in which space for results is allocated (the last unit will be trimmed after writing all result data).
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 3358 Appendix B • MySQL Configuration Directives
query_cache_size=# The memory allocated to store results from old queries.
query_cache_type=# 0 = OFF = Don’t cache or retrieve results.
1 = ON = Cache all results except SELECT SQL_NO_CACHE queries.
2 = DEMAND = Cache only SELECT SQL_CACHE queries.
query_prealloc_size=# The persistent buffer for query parsing and execution.
range_alloc_block_size=# The allocation block size for storing ranges during optimization.
read_buffer_size=# Each thread that does a sequential scan allocates a buffer of this size for each table it scans If you perform many sequential scans, you might want to increase this value.
read-only Make all tables read-only, with the exception of replication (slave) threads and users with the SUPER privilege.
read_rnd_buffer_size=# When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seek If this value is not set, then it defaults to the value
of record_buffer.
record_buffer=# The alias for read_buffer_size.
relay-log-index=name The location and name to use for the file that keeps a list of the last relay logs.
relay-log-info-file=name The location and name of the file that remembers where the SQL replication thread is in the relay logs.
relay-log=name The location and name to use for relay logs.
relay_log_purge 0 = Do not purge relay logs 1 = Purge them as soon as they are no longer needed.
relay_log_space_limit=# The maximum space to use for all relay logs.
replicate-do-db=name Tells the slave thread to restrict replication to the specified database To specify more than one database, use the directive multiple times, once for each database Note that this will work only if you do not use cross-database queries such
as UPDATE some_db.some_table SET foo='bar' while having selected a different or no base If you need cross-database updates to work, make sure you have 3.23.28 or later, and use replicate-wild-do-table=db_name.%.
data-Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 4MySQL Configuration Directives
replicate-do-table=name Tells the slave thread to restrict replication to the specified table To specify more than one table, use the directive multiple times, once for each table This will work for cross-database updates, in contrast to replicate-do-db.
replicate-ignore-db=name Tells the slave thread to not replicate to the specified base To specify more than one database to ignore, use the directive multiple times, once for each database This option will not work if you use cross-database updates If you need cross- database updates to work, make sure you have 3.23.28 or later, and use replicate-wild-ignore-table=db_name.%.
data -replicate-ignore-table=name Tells the slave thread to not replicate to the specified table To specify more than one table to ignore, use the directive multiple times, once for each table This will work for cross-database updates, in contrast to replicate-ignore-db.
replicate-rewrite-db=name Updates to a database with a different name than the original Example: replicate-rewrite-db=master_db_name->slave_db_name.
replicate-wild-do-table=name Tells the slave thread to restrict replication to the tables that match the specified wildcard pattern To specify more than one table, use the directive multiple times, once for each table This will work for cross-database updates Example: replicate-wild-do-table=foo%.bar% will replicate only updates to tables in all
databases that start with foo and whose table names start with bar.
replicate-wild-ignore-table=name Tells the slave thread to not replicate to the tables that match the given wildcard pattern To specify more than one table to ignore, use the direc- tive multiple times, once for each table This will work for cross-database updates Example:
replicate-wild-ignore-table=foo%.bar% will not update tables in databases that start with
foo and whose table names start with bar.
report-host=name The hostname or IP of the slave to be reported to the master during slave registration This will appear in the output of SHOW SLAVE HOSTS Leave unset if you do not want the slave to register itself with the master Note that it is not sufficient for the master
to simply read the IP of the slave off the socket after the slave connects Because of Network Address Translation (NAT) and other routing issues, that IP might not be valid for connect- ing to the slave from the master or other hosts.
report-password=name Undocumented.
report-port=# The port for connecting to the slave, reported to the master during slave registration Set it only if the slave is listening on a nondefault port or if you have a special tunnel from the master or other clients to the slave If you are not sure, leave this option unset.
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 5360 Appendix B • MySQL Configuration Directives
report-user=name Undocumented.
rpl-recovery-rank=# Undocumented.
safemalloc-mem-limit=# Simulate memory shortage when compiled with the debug=full option.
with -safe-mode Skip some optimize stages (for testing).
safe-show-database Deprecated option—use GRANT SHOW DATABASES instead.
safe-user-create Don’t allow new user creation by the user who has no write privileges
to the mysql.user table.
secure-auth Disallow authentication for accounts that have old (pre-4.1) passwords.
server-id=# Uniquely identifies the server instance in the community of replication partners.
set-variable=name Change the value of a variable This option is deprecated; you can set variables directly with variable-name=value.
show-slave-auth-info Show user and password in SHOW SLAVE HOSTS.
skip-grant-tables Start without grant tables This gives all users full access to all tables!
skip-host-cache Don’t cache hostnames.
skip-locking Deprecated option—use skip-external-locking instead.
skip-name-resolve Don’t resolve hostnames All hostnames are IPs or localhost.
skip-networking Don’t allow connection with TCP/IP.
skip-new Don’t use new, possibly wrong routines.
skip-show-database Don’t allow SHOW DATABASE commands.
skip-slave-start If this option is set, the slave is not autostarted.
skip-stack-trace Don’t print a stack trace on failure.
skip-symlink Don’t allow symlinking of tables Deprecated option—use symbolic-links instead.
skip -skip-thread-priority Don’t give threads different priorities.
slave_compressed_protocol Use compression on master/slave protocol.
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 6MySQL Configuration Directives
slave-load-tmpdir=name The location where the slave should put its temporary files when replicating a LOAD DATA INFILE command.
slave_net_timeout=# The number of seconds to wait for more data from a master/slave connection before aborting the read.
slave-skip-errors=name Tells the slave thread to continue replication when a query returns an error from the provided list.
slow_launch_time=# If creating the thread takes longer than this value (in seconds), the
slow_launch_threads counter will be incremented.
socket=name The socket file to use for the connection.
sort_buffer_size=# Each thread that needs to do a sort allocates a buffer of this size.
sporadic-binlog-dump-fail Option used by mysql-test for debugging and testing of replication.
sql-bin-update-same The update log is deprecated since version 5.0 and is replaced by the binary log This option no longer does anything.
sql-mode=name Syntax: sql-mode=option[,option[,option ]], where option can be one of the following: REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, ONLY_FULL_GROUP_BY, NO_UNSIGNED_SUBTRACTION.
symbolic-links Enable symbolic link support.
table_cache=# The number of open tables for all threads.
temp-pool Using this option will cause most temporary files created to use a small set of names, rather than a unique name for each new file.
thread_cache_size=# The number of threads you should keep in a cache for reuse.
thread_concurrency=# Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.
thread_stack=# The stack size for each thread.
time-format=name The time format (for future).
tmp_table_size=# If an in-memory temporary table exceeds this size, MySQL will matically convert it to an on-disk MyISAM table.
auto -tmpdir=name The path for temporary files Several paths can be specified, separated by a colon (:); in this case, they are used in a round-robin fashion.
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 7362 Appendix B • MySQL Configuration Directives
transaction_alloc_block_size=# The allocation block size for transactions to be stored in the binary log.
transaction-isolation=name The default transaction isolation level.
transaction_prealloc_size=# The persistent buffer for transactions to be stored in binary log.
use-symbolic-links Enable symbolic link support Deprecated option—use
symbolic-links instead.
user=name Run the mysqld daemon as the specified user.
verbose Used with the help option for detailed help.
version Output the version information and exit.
wait_timeout=# The number of seconds the server waits for activity on a connection before closing it.
warnings Deprecated option—use log-warnings instead.
Installation Configuration Directives
bindir=DIR This will specify the location of the user executables.
build=BUILD Configure for building on BUILD [guessed].
datadir=DIR Read-only, architecture-independent data.
disable-dependency-tracking Speeds up one-time builds.
disable-FEATURE Do not include FEATURE.
disable-largefile Omit support for large files.
disable-libtool-lock Avoid locking (might break parallel builds).
enable-assembler Use assembler versions of some string functions if available.
enable-dependency-tracking Do not reject slow dependency extractors.
enable-fast-install=PKGS Optimize for fast installation; the default is yes.
enable-FEATURE[=ARG] Include FEATURE if ARG is yes.
enable-local-infile Enable LOAD DATA LOCAL INFILE (default: disabled).
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 8Installation Configuration Directives
enable-maintainer-mode Enable make rules and dependencies not useful (and times confusing) to the casual installer.
some -enable-shared=PKGS Build shared libraries; the default is yes.
enable-static=PKGS Build static libraries; the default is yes.
enable-thread-safe-client Compile the client with threads.
host=HOST Cross-compile to build programs to run on HOST [BUILD].
includedir=DIR C header files.
infodir=DIR Specify the directory where the information documentation should be placed.
libdir=DIR Object code libraries.
libexecdir=DIR Program executables.
localstatedir=DIR Modifiable, single-machine data.
mandir=DIR The manual directory location.
oldincludedir=DIR C header files for non-GCC.
program-prefix=PREFIX Prepend PREFIX to installed program names.
program-suffix=SUFFIX Append SUFFIX to installed program names.
program-transform-name=PROGRAM Run specified PROGRAM on installed program names.
sbindir=DIR This will tell MySQL where to install the System administrator binaries.
sharedstatedir=DIR Modifiable, architecture-independent data.
sysconfdir=DIR Read-only, single-machine data.
target=TARGET Configure for building compilers for TARGET [HOST].
with-berkeley-db=DIR Use BerkeleyDB located in DIR.
with-berkeley-db-includes=DIR Find Berkeley DB headers in DIR.
with-berkeley-db-libs=DIR Find Berkeley DB libraries in DIR.
with-charset=CHARSET The default character set Use one of the following: ascii,
armscii8, big5, cp1250, cp1251, cp1256, cp1257, cp850, cp852, cp866, dec8, euckr, gb2312,
gbk, greek, hebrew, hp8, keybcs2, koi8r, koi8u, latin1, latin2, latin5, latin7, macce,
macroman, sjis, swe7, tis620, ucs2, ujis, or utf8 Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 9364 Appendix B • MySQL Configuration Directives
with-client-ldflags Extra linking arguments for clients.
with-collation=COLLATION This is defined with a charset, as seen in the with-charset
directive You can specify a collation of a charset such as latin1_swedish_ci for latin1.
with-comment Add a comment about compilation environment.
with-embedded-server Build the embedded server (libmysqld).
with-extra-charsets=CHARSET,CHARSET, Use charsets in addition to the default (none, complex, all, or a list selected from the with-charset directive).
with-gnu-ld Assume the C compiler uses GNU ld; the default is no.
with-isam Enable the ISAM table type.
with-lib-ccflags Extra CC options for libraries.
with-libwrap=DIR Compile in libwrap (tcp_wrappers) support.
with-low-memory To avoid memory limitations, try to use less memory for compiling.
with-mit-threads Always use included thread library.
with-mysqld-ldflags Extra linking arguments for mysqld.
with-mysqld-user=username Indicate the user the mysqld daemon shall be run as.
with-mysqlfs Include the CORBA-based MySQL filesystem (Common Object Request Broker Architecture).
with-named-curses-libs=ARG Use specified curses libraries instead of those cally found by configure.
automati -with-named-thread-libs=ARG Use specified thread libraries instead of those cally found by configure.
automati -with-named-z-libs=ARG Use specified zlib libraries instead of those automatically found
by configure.
with-openssl Include the OpenSSL support.
with-openssl-includes=DIR Find OpenSSL headers in DIR.
with-openssl-libs=DIR Find OpenSSL libraries in DIR.
with-other-libc=DIR Link against libc and other standard libraries installed in the ified nonstandard location overriding the default Originally added to be able to link against glibc 2.2 without making the user upgrade the standard libc installation.
spec-Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 10Installation Configuration Directives
with-PACKAGE=ARG Use PACKAGE [ARG=yes].
with-pic Try to use only PIC/non-PIC objects; the default is to use both.
with-pstack Compile in libwrap (tcp_wrappers) support.
with-pthread Force use of pthread library.
with-raid Enable MySQL internal RAID support for systems that have large file support.
with-server-suffix Append value to the version string.
with-tcp-port=port-number Indicate which port to use for MySQL services (the default
is 3306).
with-unix-socket-path=SOCKET Indicate where to put the Unix-domain socket SOCKET
must be an absolute filename.
with-vio Include the virtual IO support.
without-bench Skip building of the benchmark suite.
without-debug Build a production version without debugging code.
without-docs Skip building of the documentation.
without-extra-tools Skip building utilities in the tools directory.
without-innodb Do not include the InnoDB table handler.
without-libedit Use system libedit instead of bundled copy.
without-PACKAGE Do not use PACKAGE (same as with-PACKAGE=no).
without-query-cache Do not build query cache.
without-readline Use system readline instead of bundled copy.
without-server Build only the client.
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 11Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 12Appendix C Getting Support4337Book.fm Page 367 Saturday, June 19, 2004 5:24 PM
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 13368 Appendix C • Getting Support
Y ou’ve learned quite a bit over the course of this book, and we’re sure you will have a few questions on the many options available throughout all the installations Every installation
is different because of its unique purpose, and your future with LAMP depends upon your being able to gain further knowledge outside the scope of this book.
There are many options available when you are looking for answers to questions or ing installation types In this appendix, we’ll cover various methods of finding information and keeping up-to-date with the latest software and patches.
research-Books on Open Source Technologies
The following selection of books is organized by technology.
Jang, Michael Mastering Red Hat Linux 9. Alameda, Calif.: Sybex, 2003. This book
is written by a Red Hat Certified Engineer (RHCE) and covers everything from installation
Apache
Aulds, Charles Linux Apache Web Server Administration. Alameda, Calif.: Sybex, 2002.
This book is a complete and advanced guide to the Apache web server It teaches all of the standard and advanced techniques needed to administer Apache on a Linux server.
Coar, Ken, and Rich Bowen. Apache Cookbook. Sebastopol, Calif., 2003. This book
is a collection of problems, solutions, and practical examples for anyone who deals with Apache Sticking to its name, it includes recipes for many aspects of your server.
4337Book.fm Page 368 Saturday, June 19, 2004 5:24 PM
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 14Zawodny, Jeremy D., and Derek J Balling High Performance MySQL: Optimization,
book teaches you how to optimize, back up, replicate, and load-balance your MySQL server.
PHP
Atkinson, Leon, and Zeev Suraski. Core PHP Programming. 3d ed Upper Saddle River, N.J., 2003. This book is written by one of the founders of the Zend engine and it covers PHP 5 in depth.
Lerdorf, Rasmus, and Kevin Tatroe. Programming PHP. Sebastopol, Calif., 2002.
This book is written by the founder of PHP, Rasmus Lerdorf It covers a wide array of mation about PHP, including history, installation, usage, and more.
infor-Rosebrock, Eric Creating Interactive Websites with PHP and Web Services. Alameda, Calif.: Sybex, 2003. This book provides hands-on experience for practical uses of PHP Included in this book is an introduction to PHP, MySQL, and web services.
● Pure-FTPd (www.pureftpd.org) ProFTPD (www.proftpd.org)
4337Book.fm Page 369 Saturday, June 19, 2004 5:24 PM
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 15370 Appendix C • Getting Support
These installations are relatively painless and both can be found in the tutorials section for servers on the linuxforum.com site To install them, visit the site and look in the left column for the Servers link in the Tutorial submenu.
BIND BIND is a DNS server (called named ) which stands for Berkeley Internet Name Domain DNS servers are used to translate domain names to IP addresses, which in turn tells the client computer where to find the web server, e-mail server, name servers, and so on.
If you are going to be using virtual hosts on your system, you might want to look into ing and configuring a name server This can be a complicated process, however, so you might wish to pick up one of the books we referenced in the preceding section covering network servers You can find information and the download to the latest version of BIND on the Internet Systems Consortium (ISC) site located at www.isc.org.
install-Local Resources
In addition to published books, you should also make use of your local resources By this we mean the actual operating system you are working on Get to know the man command and make frequent use of the help flag for most command-line programs on your system These can provide quick answers after you get used to reading their format Remember, you can pipe the results of your help flag to more or less for easier reading if they present you with hundreds
of lines of options.
Although the manuals can often leave you looking for more answers, they are an excellent place to begin If you are still confused or need more information, it is time to turn to one of your books or the Internet.
Internet Resources
Internet resources come in many flavors: websites, mailing lists, newsgroups, and Internet Relay Chat services (IRC) Each provides crucial information in its own way Search engines will return a staggering number of resources, and you can spend days sifting through them The following selections will get you started and might provide all you need.
Websites
We have taken the time to create support communities for Linux, Apache, MySQL, and PHP, which are available for free with no membership needed and no money to pay (the first site listed in each of the following categories) In addition to our sites, there are many other com- munities available through the Web that feature information pertaining to LAMP Listed here
4337Book.fm Page 370 Saturday, June 19, 2004 5:24 PM
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 16Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 17372 Appendix C • Getting Support
Mailing Lists
Mailing lists are a great way to stay up-to-date on the latest patches, fixes, bugs, and updates
There are official and unofficial mailing lists for almost every technology that will enable you to
automatically receive e-mails on the latest happenings Many of these mailing lists also have their
own newsgroups Some of these mailing lists are moderated, and some are not Many of the lists
will provide you with too many e-mails to reasonably go through if you subscribed to them all
Here are a few links to the official mailing lists for the technologies used in this book:
NOTE These are just the links to the official mailing lists, which will pertain to everyone reading
this book You can find additional mailing lists by performing a search on the Web or byvisiting the links we provided in the “Websites” section
Newsgroups
Newsgroups can be an excellent source of information Finding good newsgroups can be
tricky, so here’s a helpful selection:
NOTE Some of these newsgroups might not be available to your news service provider If you
wish to find a high-power news service provider with high retention rates, check outwww.giganews.com
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 18To view newsgroups, you will also need to have a client installed to handle the tions and to format your data It might be easier to install a client for X11 that will provide you with a more graphical layout and greater usability Listed here are a few of the more popular news clients for Linux:
communica-● Netscape
● Knews
● News Peruser
● GFetchnews You could choose to install your own news server, although this can take an enormous amount of server process and bandwidth so it is not recommended If you have access to both
of these and would like to give it a shot, here are a few available news servers to take a look at:
● InterNetNews (INN)
● Leafnode
● Ozway
Internet Relay Chat
Internet Relay Chat (IRC) is an excellent source for near-instant help for free IRC enables you
to connect to a server that provides you with chat rooms and the ability to send files through
4337Book.fm Page 373 Saturday, June 19, 2004 5:24 PM
Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com
Trang 19374 Appendix C • Getting Support
a Data Communications Channel (DCC) Each room might have one or more operators to keep messages organized and many times free from spam Here are a few IRC channels for you
to visit in your search for help:
coordi-To connect to the freenode network, you will need to acquire an IRC client for your computer This is required as irc.freenode.net is not a web server You might wish to use a command cli- ent such as ircII, XChat, or BitchX if you will be accessing IRC from your Linux computer Oth- erwise, you can choose any of the available clients you can find on the Web There are plenty of free applications that will get the job done Often, there are multiple clients based on an original program, such as ircII or mIRC (for Windows) You should refer to each program’s documen- tation for more information on setting up and configuring your client Just make sure you are connecting to one of the irc.freenode.net servers if you wish to access their channels Simpo PDF Merge and Split Unregistered Version - http://www.simpopdf.com