Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am doing MysqlReplication on Linux/Debian I have installed mysql.

Now the first setp for mysql replication is to edit the /etc/mysql/my.cnf file. But that is not available in the location.

So how can I edit that ?

Any Idea?


share|improve this question

I suggest you run:

locate my.cnf

If you installed mysql manually the files may be installed under the PREFIX directory. That is usually /usr/local or the location you chose.

which mysql

Maybe helps finding the prefix dir.

If there is still no my.cnf to be found you can find a lot of example my.cnf files for nearly every possible case on the googlenet.

share|improve this answer

Just create the file with the text editor of your choice.

share|improve this answer
It is instructed to edit It means already that has to be available.I can create and can write only those content those are available to edit. What about other those are by default. – sjain Jul 30 '10 at 11:46
Just copy an example my.cnf from /usr/share/doc/mysql-server-5.0/examples directory. Pick the one that seems most appropriate for you. Please note that the examples are gzip archives by default, so you need to ungzip them for example with gzip -d some_conf_file.cnf.gz – Janne Pikkarainen Jul 30 '10 at 12:04
Thanks for reply I have installed MySQL using .tar.gz file.This may be the reason that /usr/share/doc/.... directory is not available.Is there any other location for the my.cnf file when using the tar.gz installation. – sjain Jul 30 '10 at 12:19
ok. If that tar.gz approach is not necessary for you, command apt-get install mysql-server mysql-client will set the basics up for you. – Janne Pikkarainen Jul 30 '10 at 12:38
Thanks I will move that but I dont get the information about all the installed directory, That's why I didnot want to move for apt-get command.One more thing I want to ask : Does apt-get command automaticall create /etc/init.d/mysql startup script or we have to write? Thanks – sjain Jul 30 '10 at 12:56

It also depends upon the version of MySQL you are using. I upgraded RHEL5 from 5.0 to 5.5, using 5.1 as a transition, because the database structures are different.

The my.cnf file is in /opt/rh/mysql55/root/etc/my.cnf

I still have /etc/my.cnf, but that is for the mysql 5.0. The vendor of our software tells me there are dependencies which prevent removal of the mysql 5.0 package, so I have both on the system. Confusing, sometimes.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .