Bug #50030 Does not find mysqld section in my.ini file
Submitted: 2 Jan 2010 19:48 Modified: 11 Oct 2013 15:23
Reporter: David Krings Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: Administration Severity:S2 (Serious)
Version:5.2.11 OSS beta rev 4842 OS:Windows (2003 Server 32bit)
Assigned to: Assigned Account CPU Architecture:Any

[2 Jan 2010 19:48] David Krings
Description:
Note: The MySQL installation is not in the default location.

A) Steps to take
1. Start wizard for new instance
2. Message appears after a few steps that my.ini cannot be found
3. Manually locate my.ini and test path (test is successful)
4. Specify section with specific server configuration as "mysqld"
5. Test settings for section

B) What happens
Error appears that section cannot be found, but section exists. From my.ini file:

...
# The MySQL server
[mysqld]
basedir                 = "D:/mysql/"
datadir                 = "D:/mysql/data/"
port		            = 3306
socket		            = "MySQL"
...

C) What should happen
Should detect section properly.

How to repeat:
Happens every single time using the steps shown above.

Suggested fix:
Should be able to properly parse specified ini file and detect section.
[5 Jan 2010 8:30] Susanne Ebrecht
The file itself couldn't be found or just the section?
[5 Jan 2010 12:10] David Krings
Only the section is not found. The file is there and when testing for the my.ini to be present when specifying the path I get the OK that the my.ini file was found. When I look at the my.ini file the section in question is there (see original submission).
[5 Jan 2010 15:42] Jeremy Wilson
I am able to replicate this issue from Windows 7, connecting to a CentOS 5 distro as well, using RSA over SSH. 

The workbench application indicates that the path is valid, but the "mysqld" section in the config file cannot be found. The section is indeed in the configuration file. Note that the my.cnf configuration file is using the innodb huge template and the mysql is parsing the config file and running just fine.

Permissions on the file are 760 and the user authenticating belongs to the mysql group. I am able to logon as that user through ssh and gain read/write access, so the permissions are ok.
[14 Jan 2010 6:19] Susanne Ebrecht
Verified as described.

But I have an easier way to test this:

1) install server in your home
2) switch to the installation directory
$ mkdir etc
$ cd etc
$ echo -e -n "[mysqld]\nport = 6951\nsocket = /tmp/mysql51bzr.sock\n[client]\nport = 6951\nsocket = /tmp/mysql51bzr.sock" > my.cnf
$ cd ../bin
$ ./mysql_install_db --defaults-file=/home/USER/INSTALLATION_DIR/etc/my.cnf
$ cd ../libexec
$ ./mysqld --defaults-file=/home/USER/INSTALLATION_DIR/etc/my.cnf &

After that start Workbench ...
Configure the connection

And then try to change something in your my.cnf by using Workbench.
[28 Jan 2010 11:59] Maksym Yehorov
I can not repeat that neither on Win7(x64), nor on linux. Both config file and section can be found. Also I can modify config file for custom installed mysql server.
[1 Feb 2010 17:17] Johannes Taxacher
could you try again with latest version as its not repeatable for us anymore.
[2 Mar 2010 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[20 Mar 2010 0:50] mike montagne
On our brand new OSX Leopard installation of MySQL 5.1.44 and MySQLWorkbench 5.2.16, we found that this problem was due to a missing /etc/my.cnf file. 

The following articles were helpful in constructing such a file with the missing [mysqld] and other sections:

http://ronaldbradford.com/blog/how-do-i-identify-the-mysql-my-cnf-file-2010-03-09/
http://ronaldbradford.com/blog/be-sure-to-know-your-my-cnf-sections-2010-01-26/

Effectively, we solved this issue for ourselves by constructing the missing file with the following missing content (for a local system, testing Ruby):

# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /usr/local/mysql/data) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password       = your_password
port            = 3306
socket          = /tmp/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
key_buffer_size = 16K
max_allowed_packet = 1M
table_open_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 128K

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
# 
#skip-networking
server-id       = 1

# Uncomment the following if you want to log updates
#log-bin=mysql-bin

# binary logging format - mixed recommended
#binlog_format=mixed

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /usr/local/mysql/data/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /usr/local/mysql/data/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M

[mysqlhotcopy]
interactive-timeout

Hope this helps others. This was a real headache to resolve.

m
[5 Sep 2013 19:46] Kyle Sidles
Make sure the [mysqld] section is all lowercase - In my case the my.ini file had [MySQLD] and was causing the same problem described here.  I changed this to [mysqld] and the problem went away.

Hope that helps.