[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you are going to use storage engines that support transactional tables
(InnoDB
, BDB
),
you should first create a `my.cnf' file and set startup options
for the engines you plan to use. See section 14. MySQL Table Types.
When the mysqld
server starts, it changes location to the
data directory. This is where it expects to write log files and the pid
(process ID) file, and where it expects to find databases.
The data directory location is hardwired in when the distribution is
compiled. However, if mysqld
expects to find the data directory
somewhere other than where it really is on your system, it will not work
properly. If you have problems with incorrect paths, you can find out
what options mysqld
allows and what the default path settings are by
invoking mysqld
with the --help
option. You can override the
defaults by specifying the correct pathnames as command-line arguments to
mysqld
. (These options can be used with mysqld_safe
as well.)
Normally you should need to tell mysqld
only the base directory under
which MySQL is installed. You can do this with the --basedir
option. You can also use --help
to check the effect of changing path
options (note that --help
must be the final option of the
mysqld
command). For example:
shell> EXECDIR/mysqld --basedir=/usr/local --help |
Once you determine the path settings you want, start the server without
the --help
option.
Whichever method you use to start the server, if it fails to start up
correctly, check the log file to see if you can find out why. Log files
are located in the data directory (typically
`/usr/local/mysql/data' for a binary distribution,
`/usr/local/var' for a source distribution, and
`\mysql\data\mysql.err' on Windows). Look in the data directory for
files with names of the form `host_name.err' and
`host_name.log' where host_name
is the name of your server
host. Then check the last few lines of these files:
shell> tail host_name.err shell> tail host_name.log |
Look for something like the following in the log file:
000729 14:50:10 bdb: Recovery function for LSN 1 27595 failed 000729 14:50:10 bdb: warning: ./test/t1.db: No such file or directory 000729 14:50:10 Can't init databases |
This means that you didn't start mysqld
with --bdb-no-recover
and Berkeley DB found something wrong with its log files when it
tried to recover your databases. To be able to continue, you should
move away the old Berkeley DB log file from the database directory to
some other place, where you can later examine it. The log files are
named `log.0000000001', where the number will increase over time.
If you are running mysqld
with BDB
table support and mysqld
core
dumps at start this could be because of some problems with the BDB
recovery log. In this case you can try starting mysqld
with
--bdb-no-recover
. If this helps, then you should remove all
`log.*' files from the data directory and try starting mysqld
again.
If you get the following error, it means that some other program (or another
mysqld
server) is already using the TCP/IP port or socket
mysqld
is trying to use:
Can't start server: Bind on TCP/IP port: Address already in use |
Can't start server: Bind on unix socket... |
Use ps
to make sure that you don't have another mysqld
server
running. If you can't find another server running, you can try to execute
the command telnet your-host-name tcp-ip-port-number
and press
Enter a couple of times. If you don't get an error message like
telnet: Unable to connect to remote host: Connection refused
,
something is using the TCP/IP port mysqld
is trying to use.
See 2.4.2.1 Problems Running mysql_install_db
and 5.9 Running Multiple MySQL Servers on the Same Machine.
If mysqld
is currently running, you can find out what path settings
it is using by executing this command:
shell> mysqladmin variables |
or:
shell> mysqladmin -h 'your-host-name' variables |
If you get Errcode 13
, which means Permission denied
, when
starting mysqld
this means that you didn't have the right to
read/create files in the MySQL database or log directory. In this case
you should either start mysqld
as the root
user or change the
permissions for the involved files and directories so that you have the
right to use them.
If mysqld_safe
starts the server but you can't connect to it,
you should make sure you have an entry in `/etc/hosts' that looks like
this:
127.0.0.1 localhost |
This problem occurs only on systems that don't have a working thread library and for which MySQL must be configured to use MIT-pthreads.
If you can't get mysqld
to start you can try to make a trace file
to find the problem. See section D.1.2 Creating Trace Files.
If you are using InnoDB
tables, refer to the InnoDB
-specific startup
options. See section 14.4.3 InnoDB Startup Options.
If you are using BDB
(Berkeley DB) tables, you should familiarise
yourself with the different BDB
-specific startup options.
See section 14.5.3 BDB
Startup Options.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |