Learning Mysql



Download 4.24 Mb.
View original pdf
Page348/366
Date04.08.2023
Size4.24 Mb.
#61806
1   ...   344   345   346   347   348   349   350   351   ...   366
Learning MySQL
382 | Chapter 12:
Configuring and Tuning the Server

Now consider the case where MySQL has been installed to the directory /home/adam/
mysql-5.0.22. You can imagine the directory /Users/adam/mysql-5.0.22 being used for
Mac OS X. For nonstandard installations, the mysqld_safe program should be called from the MySQL installation directory, so we first change to that directory cd /home/adam/mysql-5.0.22
and then start the server by typing (all on one line bin/mysqld_safe \
-port \
--socket=/home/adam/mysql-5.0.22/logs/mysqld-new.sock.file \
--basedir=/home/adam/mysql-5.0.22 \
--datadir=/home/adam/mysql-5.0.22/data \
--log=/home/adam/mysql-5.0.22/logs/main.log \
--log-error=/home/adam/mysql-5.0.22/logs/error.log \
--pid-file=/home/adam/mysql-5.0.22/logs/zahra.pid
The corresponding options file entries would be:
[mysqld]
port= socket /home/adam/mysql-5.0.22/logs/mysqld-new.sock.file basedir= /home/adam/mysql-5.0.22
datadir= /home/adam/mysql-5.0.22/data log /home/adam/mysql-5.0.22/logs/main.log log-error=/home/adam/mysql-5.0.22/logs/error.log pid-file= /home/adam/mysql-5.0.22/logs/zahra.pid
Finally, let’s look at an example for Windows, where we have MySQL installed in the directory C:\mysql-5.0.22-win32. We want to have the MySQL datafiles placed in
C:\mysql\data, we want the logfiles placed in C:\mysql\logs, and we want the server to listen on port 13306. So we type (all on one line):
C:\>mysqld-net.exe \
-port \
--basedir=C:\mysql-5.0.22-win32 \
--datadir=C:\mysql\data \
--log-bin=C:\mysql\logs\mysql-binary.log
Note that the specified directories must exist, and the data directory must contain the mysql database files (the privilege tables otherwise, MySQL will complain and abort.

Download 4.24 Mb.

Share with your friends:
1   ...   344   345   346   347   348   349   350   351   ...   366




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

    Main page