Bug #23837 | Configuration file not found | ||
---|---|---|---|
Submitted: | 1 Nov 2006 13:33 | Modified: | 2 Nov 2006 11:12 |
Reporter: | Anthony Marston | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Administrator | Severity: | S2 (Serious) |
Version: | 5.0-r5 | OS: | Windows (Windows XP) |
Assigned to: | Mike Lischke | CPU Architecture: | Any |
[1 Nov 2006 13:33]
Anthony Marston
[1 Nov 2006 14:38]
MySQL Verification Team
Thank you for the bug report.
[2 Nov 2006 9:49]
Mike Lischke
MA heavily depends on the ability to find the correct configuration file for a particular server. If it cannot find it then it cannot change any config value. Unfortunately, there are so many possibilities where a my.ini or my.cnf file can be located and the server does not tell us which config file it used actually. So we have search it using this strategy: 1) Get the port of the server from the connection settings. 2) Enumerate all installed and running "%mysql%" services (which implicitly leaves out any manually started server instances) and get their config files by parsing the parameter string for that service entry. They usually have a "--defaults-file=" part which contains the path to the config file. 3) Open the config file, parse it and compare the stored port value with that gotten from the connection settings. 4) If the port matches use this config file. This approach has several limitations: 1) If there is no ""--defaults-file" parameter then we cannot compare the port. 2) If the config file does not exist then we cannot compare the port. 3) If the config file does not contain a port setting then we cannot compare the port. 4) Due to a problem in the server (on Windows) the service parameters must contain an entry for the section to be used in the config file, which *must* have the same name as the service the server is running under or it will simply not start. Since the default section value used by the installer is [mysql] is not valid (it is used for non-gui clients) the server automatically falls back to [mysqld]. However if the user is somebody who takes care for clean installations and has more than one server instance he will likely give it a different name (I usually use mysql41, mysql50, mysql51 etc.). By default these section do not exist in the config file so the server again falls back to [mysqld] (as does MA). A bit esoteric, but still possible: if now somebody adds the, say [mysql50] section manually, without a port entry MA will use that section (since the server parameter says this is the one) and does not find a port to compare with, and again fails. If the server would tell us which config file it is actually using, things would be much easier. But it does not, so ... Anthony, the reason why I wrote all that is that I want ask you to check if any of the limitations apply to your installation, which would then explain why MA fails.
[2 Nov 2006 10:05]
Anthony Marston
Attached is a copy of my config file which works with 5.0-r4: <config> [WinMySQLAdmin] Server=F:/MYSQL/bin/mysqld-max-nt.exe host=localhost user=tony password=******* [mysqld] basedir=F:/MYSQL bind-address=127.0.0.1 datadir=F:/MYSQL/data language=F:/MYSQL/share/english log-error=mysql.err #slow query log#= #tmpdir#= #port=3306 #set-variable=key_buffer=16M #skip-innodb # Data file(s) must be able to hold your data and indexes. # Make sure you have enough free disk space. innodb_data_file_path = ibdata1:10M:autoextend # Set buffer pool size to 50 - 80 % of your computer's memory set-variable = innodb_buffer_pool_size=256M set-variable = innodb_additional_mem_pool_size=64M # Set the log file size to about 25 % of the buffer pool size set-variable = innodb_log_file_size=64M set-variable = innodb_log_buffer_size=8M # Set ..flush_log_at_trx_commit to 0 if you can afford losing some last transactions innodb_flush_log_at_trx_commit=1 </config> This exists in the C:\WINDOWS directory. I tried copying it to the directory where the software is installed (F:\MySQL) but it had no effect. It works with 5.0.r-4 but not 5.0-r5
[2 Nov 2006 10:31]
Mike Lischke
That was quick, thank you. Try enabling the port entry (which is currently out-commented). However, I think the problem is a bit more complex. Open your services list and look for the mysql service (I assume you only have one). Double click it to see its settings. Pay particular attention to the exe path entry. It looks like: "C:\Programme\MySQL\MySQL Server 5.0\bin\mysqld-nt" --defaults-file="C:\Programme\MySQL\MySQL Server 5.0\my.ini" MySQL50 The ini path should be given there if you have used the normal setup. I strongly recommend *not* to use a config file that sits in the system folder. This can (and will as you see right now) produce all kind of problems. The standard setup puts the ini file in the root folder of the server, which is a good place for it (see also http://dev.mysql.com/doc/refman/5.0/en/mysql-config-wizard-file-location.html). Actually, things are much more complex (read here: http://dev.mysql.com/doc/refman/5.0/en/option-files.html) and MA is not able to cope with all the variants. If you want to use MA to manage your option file then it must be mentioned as parameter in the service entry (as written above), it must exist and it must contain the correct port setting.
[2 Nov 2006 11:12]
Anthony Marston
I uncommented that port entry, installed 5.0r-5 and MySQL Administrator now works. Thanks.
[21 Nov 2006 16:38]
Craig Reilly
I have this same problem, but do not understand how to fix it. When I go into the MySql Admin and turn off InnoDB, hit Apply and Exit. Next time I try to launch MySqlAdmin, I get that error. To fix it, I open the INI file and uncomment the Port entry. Now I log in ok to mysqladmin but InnoDB is on again. Any ideas? Service Entry: "D:\MySQL\MySQL Server 5.0\bin\mysqld" --defaults-file="D:\MySQL\MySQL Server 5.0\my.ini" "MySQL" Ini File: # CLIENT SECTION [client] port=3306 [mysql] default-character-set=latin1 # SERVER SECTION # ---------------------------------------------------------------------- [mysqld] #key_buffer = 256M #max_allowed_packet = 1M #table_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 # The TCP/IP Port the MySQL Server will listen on port=3306 #Path to installation directory. All paths are usually resolved relative to this. #basedir="D:/MySQL/MySQL Server 5.0/" #Path to the database root #datadir="D:/MySQL/MySQL Server 5.0/Data" #default-character-set=latin1 #default-storage-engine=INNODB #sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" #max_connections=100 #query_cache_size=0 #table_cache=256 #tmp_table_size=18M #thread_cache_size=8 #*** MyISAM Specific options #myisam_max_sort_file_size=100G #myisam_max_extra_sort_file_size=100G #myisam_sort_buffer_size=35M #key_buffer_size=25M #read_buffer_size=64K #read_rnd_buffer_size=256K #sort_buffer_size=256K #*** INNODB Specific options *** # Use this option if you have a MySQL server with InnoDB support enabled # but you do not plan to use it. This will save memory and disk space # and speed up some things. #skip-innodb # Additional memory pool that is used by InnoDB to store metadata # information. If InnoDB requires more memory for this purpose it will # start to allocate it from the OS. As this is fast enough on most # recent operating systems, you normally do not need to change this # value. SHOW INNODB STATUS will display the current amount used. #innodb_additional_mem_pool_size=2M # If set to 1, InnoDB will flush (fsync) the transaction logs to the # disk at each commit, which offers full ACID behavior. If you are # willing to compromise this safety, and you are running small # transactions, you may set this to 0 or 2 to reduce disk I/O to the # logs. Value 0 means that the log is only written to the log file and # the log file flushed to disk approximately once per second. Value 2 # means the log is written to the log file at each commit, but the log # file is only flushed to disk approximately once per second. #innodb_flush_log_at_trx_commit=1 # The size of the buffer InnoDB uses for buffering log data. As soon as # it is full, InnoDB will have to flush it to disk. As it is flushed # once per second anyway, it does not make sense to have it very large # (even with long transactions). #innodb_log_buffer_size=1M # InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and # row data. The bigger you set this the less disk I/O is needed to # access data in tables. On a dedicated database server you may set this # parameter up to 80% of the machine physical memory size. Do not set it # too large, though, because competition of the physical memory may # cause paging in the operating system. Note that on 32bit systems you # might be limited to 2-3.5G of user level memory per process, so do not # set it too high. #innodb_buffer_pool_size=47M # Size of each log file in a log group. You should set the combined size # of log files to about 25%-100% of your buffer pool size to avoid # unneeded buffer pool flush activity on log file overwrite. However, # note that a larger logfile size will increase the time needed for the # recovery process. #innodb_log_file_size=24M # Number of threads allowed inside the InnoDB kernel. The optimal value # depends highly on the application, hardware as well as the OS # scheduler properties. A too high value may lead to thread thrashing. #innodb_thread_concurrency=18 #Enable this option only if you would like to use InnoDB tables. #skip-innodb #Enter a name for the binary log. Otherwise a default name will be used. #log-bin="D:/MySQL/MySQL Server 5.0/Logs/binlog.log" #Enter a name for the query log file. Otherwise a default name will be used. #log="D:/MySQL/MySQL Server 5.0/Logs/query.log" #Enter a name for the error log file. Otherwise a default name will be used. #log-error="D:/MySQL/MySQL Server 5.0/Logs/error.log" #Enter a name for the slow query log. Otherwise a default name will be used. #log-slow-queries="D:/MySQL/MySQL Server 5.0/Logs/slow.log" #Enter a name for the update log file. Otherwise a default name will be used. #log-update="D:/MySQL/MySQL Server 5.0/Logs/update.log" #Enable this option only if you would like to use InnoDB tables. #skip-innodb
[30 Aug 2007 7:15]
Tom Juergens
This bug has been closed, but I'm not really satisfied with that, since I am having the same problem and none of the suggestions posted have helped me. Running Server 4.1.21 as a Windows service with --defaults-file=... and the most current release of the GUI tools, r12, MySQL Administrator gives me the error "Either the server service or the configuration file could not be found. Startup variables and service section are therefore disabled." The server is running on Port 8501, which is configured in my.ini. Since none of the other hints applied or helped, I deinstalled r12 and downloaded r4 instead, which the OP had claimed worked for him. As I hoped, it works for me, too. That does suggest to me that there must be something wrong with releases after r4. If this comment does not reopen this bug, I guess I'll have to file a new one.
[2 Apr 2009 18:23]
steven hanley
Agh. If I read this correctly I'll _never_ get the gui tools to work for a manual start of mysql. Wouldn't it be easy, perhaps even trivial, for the gui tools to read an environment variable which points to the mysql server install basedir?? You could have one that pointed to a non-standard INI location too -- but pointing to the basedir seems like a minimum.