MySQL Forums
Forum List  »  General

Problems creating my.cnf / options file
Posted by: Jon Swenson
Date: August 01, 2011 07:11AM

Greetings MySQL forum users,

Any help with the below problem would be greatly appreciated :-)

My computer specs:
Mac osx 10.5.8
MySQL 5.1

-- Short summary of the problem --
I have been building serveral PHP applications on my computer using MySQL as the database.
MySQL has been working great for 3 years:-)
I decided to modify the ft_min_word_len setting
so an application I was building could search for 3 letter words instead of only words
over 4 characters long. I tried to change ft_min_word_len setting
from 4 to 3 by creating a my.cnf file and changed the ft_min_word_len setting to 3.
I restarted my computer hoping the changes would take effect and boom
my database stopped working. I cannot even turn it on. aiya!

-- Details on how I created the problem --
1.) I chose a sample options file template that mysql includes in
/usr/local/mysql/support-files and saved it in the /etc/ directory as my.cnf.
I chose the my-large.cnf file as my template.
Here are the permissions for the new my.cnf file
-rw-r--r-- 1 root wheel 4775 Aug 1 15:17 /etc/my.cnf
Below are mysql docs that led me to do this:

2.) I used vi to add the need setting that I desired and saved
the file as: /etc/my.cnf
I added the setting ft_min_word_len = 3
Now, the [mysqld] section of my.cnf file looks like this:
port = 3306
socket = /tmp/mysql.sock
key_buffer_size = 256M
max_allowed_packet = 1M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
ft_min_word_len = 3

3.) The problem begins.
After making the above changes, I tried to restart MySQL and
it would not restart. So, I restarted my computer and MySQL
still would not restart.

If I try:
/usr/local/mysql/bin/mysql mysql -u root -p
I get the below error message:
ERROR 2002 (HY000): Can't connect to local MySQL server through
socket '/tmp/mysql.sock' (2)

MySQL documentation says if you get this error
"Make sure that the server is running. If it is not, clients cannot connect to it.
For example, if an attempt to connect to the server fails with a message such as one of those following, one cause might be that the server is not running:"
This is my problem. The server is not on and I cannot turn it on.

Many MySQL posts regarding ERROR 2002 recommend checking the
error log file for more details about the problem.
This was not easy to figure out how to do
so here is the command I used to get the error log.
sudo vi /usr/local/mysql/data/macbook-2.local.err
Hopefully, this will help someone.

When I try to turn on MySQL from the System Preference panel in MAC, the error log message created is:
110801 18:09:42 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
110801 18:09:42 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
^G/usr/local/mysql/bin/mysqld: File './mysql-bin.index' not found (Errcode: 13)
110801 18:09:42 [ERROR] Aborting
110801 18:09:42 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete
110801 18:09:42 mysqld_safe mysqld from pid file /usr/local/mysql/data/ ended

Interestingly, if I try to log in from the command line using:
/usr/local/mysql/bin/mysql mysql -u root -p
It does not create an error message in the error log. Only when I try to log in from System Preference is
an error message created in the error log.

After doing the above trouble shooting, it looks like I have the following problems:
a.) According to ERROR 2002 there is a problem with /tmp/mysql.sock.
However, if I open the /tmp/ directory there is not mysql.sock file. However, if I run the command:
locate mysql.sock.
It returns: /private/tmp/mysql.sock as the location of the mysql.sock file.
So, it looks like mysql.sock exists but I cannot find it or modify it's permissions. Strange.
Please advise how to find this file. Are the permissions of mysql.sock needing to be

b.) I have a [Warning] and (Errcode: 13):
[Warning] Setting lower_case_table_names=2 because file system for /usr/local/mysql/data/ is case insensitive
^G/usr/local/mysql/bin/mysqld: File './mysql-bin.index' not found (Errcode: 13)
From this message I assume the major problem is with the ./mysql-bin.index file.
However, I cannot find this file either. Is there a permissions problem with this file?
Please advise how to find this file or solve this problem.

One other thing I tried to do was restart the DB server from the command line using:
/usr/local/mysql-5.1.36-osx10.5-x86_64/support-files/mysql.server restart
If I do this I get the following error:
ERROR! MySQL manager or server PID file could not be found!
Starting MySQL
. ERROR! Manager of pid-file quit without updating file.

My database was working great for 3 years.
However, I tried to create one my.cnf file and
I effectually broke MySQL. I cannot even turn it on or restart it.
Any advice to solve this issue would be much appreciated :-)


Options: ReplyQuote

Written By
Problems creating my.cnf / options file
August 01, 2011 07:11AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.