Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Life without "my.cnf" parameter file 2

Status
Not open for further replies.

DeepDiverMom

Programmer
Jul 28, 2003
122
US
I inherited a 4.0.17-Max MySQL instance running just fine on Red Hat Linux rel. 9, kernel 2.4.20-8smp on an i686. (I am a neophyte MySQL DBA.)

As root, I have done, "find / -name my.cnf", with no results. My presumption is that MySQL looks for "my.cnf", but when it doesn't find the file, uses default values for instance parameters.

Could someone help me with answers to these questions:

1) Can you confirm that MySQL will start and run with default values for database parameters?
2) What query/command do I use to confirm current parameter values?
3) In which path do I place the "my.cnf" parameter file? And what is the typical format?
4) Recognizing that one size does not fit all, could someone post the contents of a sample production "my.cnf" parameter file so we can at least begin with sane/credible parameter values?

Thanks,

Becca
 
I only use MySQL on W*****s, but according to the MySQL manual, Unix systems look for /etc/my.cnf.

A simple my.cnf would contain something like:[tt]
[mysqld]
basedir=u:/mysql
datadir=d:/mysql
skip-innodb[/tt]

where:
basedir is the path to the MySQL directory;
datadir is the path to the MySQL data directory (which defaults to basedir/data/).
skip-innodb tells the server to save resources by not catering for InnoDB databases.
There are loads of other options available; these are described in the MySQL manual.

If MySQL does not find my.cnf, it uses default options.

To find out the values of system variables, you can use the SQL command:[tt]
SHOW VARIABLES[/tt]



-----
ALTER world DROP injustice, ADD peace;
 
Heres my current my.cnf, bear in mind this server replicates (and is the master).

[mysqld]
skip-innodb
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-bin
server-id=1
binlog-do-db=db_one
binlog-do-db=db_two
set-variable = max_connections=200
set-variable = max_allowed_packet=2000000

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid



______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Some distros place the configuration in /etc/mysql/my.cnf as opposed to /etc/my.cnf

If you create a /etc/my.cnf and mysql fails to start try the above as well.

D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top