Learning Mysql



Download 4.24 Mb.
View original pdf
Page345/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   341   342   343   344   345   346   347   348   ...   366
Learning MySQL
The MySQL Server Daemon
The main MySQL server program, or MySQL server daemon, is called mysqld
. Under
Windows, there are two main programs you can use mysqld-nt.exe—which is optimized for Windows XP, 2000, and NT (and probably soon, for Vista)—and
mysqld.exe, which can work on older versions of Windows.
On Linux or Mac OS X, the recommended way to start the mysqld program is by calling the mysqld_safe script. This in turn starts mysqld or, if it’s available, mysqld-max
—a
379

variant of the MySQL server that includes some more cutting-edge (and less commonly used) features. It also turns on server error logging, which you’d otherwise need to specify as an option to mysqld
, and automatically restarts the server if it crashes. Prior to MySQL version 4, this was called safe_mysqld
. On a Linux or OS X installation, you will still find a symbolic link called safe_mysqld pointing to mysqld_safe
MySQL Server Options
The MySQL server is a complex piece of software and has many settings that you can tweak to make it better fit your needs. We’ll discuss some of the more useful server options here. mysqld_safe accepts a number of options of its own and passes on any options it doesn’t handle to mysqld
. The options specific to mysqld_safe are probably not of interest to most readers of this book you can find these by typing mysqld_safe -help at the command line:
basedir
This tells mysqld where MySQL is installed on the system. If you don’t specify this option, the program will try to use the location specified when the program was compiled.
datadir
This tells mysqld where the database files are stored.
defaults-file
This specifies the location of the options file to read this is particularly useful if you want the server to read in options from a nondefault location.
enable-named-pipe
Allows a server running under Windows to use a named pipe. See skip-networking for more information.
init-file
This specifies a text file containing SQL commands that the server must execute when starting up. This is commonly used to reset a forgotten MySQL root password as discussed in Resetting Forgotten MySQL Passwords in Chapter 9.
log
This tells mysqld to use the specified file to log every client connection and query.
log-bin
This specifies where you want the binary log of commands that attempt to modify data on the server.
log-error
This tells mysqld to use the specified file to log server startup, shutdown, and errors.
By default, this is the file .err in the data directory. For example, the log might show that we’ve run out of disk space:

Download 4.24 Mb.

Share with your friends:
1   ...   341   342   343   344   345   346   347   348   ...   366




The database is protected by copyright ©ininet.org 2024
send message

    Main page