Search the MySQL manual:

2.6.1.2 Starting MySQL on Windows NT, 2000, or XP

To get MySQL to work with TCP/IP on Windows NT 4, you must install service pack 3 (or newer)!

Normally you should install MySQL as a service on Windows NT/2000/XP. In case the server was already running, first stop it using the following command:

shell> C:\mysql\bin\mysqladmin -u root shutdown

This invokes the MySQL administrative utility mysqladmin to connect to the server as root, which is the default administrative account in the MySQL grant system. Please note that users in the MySQL grant system are wholly independent from any login users under Windows.

Now install the server as a service:

shell> C:\mysql\bin\mysqld --install

The service is installed with the name MySql. Once installed, it can be immediately started from the Services utility, or by using the command NET START MySql.

Once running, mysqld can be stopped by using the Services utility, the command NET STOP MySql, or the command mysqladmin shutdown.

If any startup options are required, you can place them in the [mysqld] group of any of the standard option files. As of MySQL 4.0.3, you can place options in the [mysqld] group of any option file and use a --defaults-file option to tell the server the name of the file when you install the service. For example:

shell> C:\mysql\bin\mysqld --install MySql --defaults-file=C:\my-opts.cnf

You can also specify options as ``Start parameters'' in the Windows Services utility before you start the MySQL service.

The Services utility (Windows Service Control Manager) can be found in the Windows Control Panel (under Administrative Tools on Windows 2000). It is advisable to close the Services utility while performing the --install or --remove operations, this prevents some odd errors.

Please note that from MySQL version 3.23.44, you have the choice of setting up the service as Manual instead (if you don't wish the service to be started automatically during the boot process):

shell> C:\mysql\bin\mysqld --install-manual

When MySQL is running as a service, the operating system will automatically stop the server on computer shutdown. In MySQL versions older than 3.23.47, Windows waited only for a few seconds for the shutdown to complete, and killed the database server process if the time limit was exceeded. This had the potential to cause problems. (For example, at the next startup the InnoDB storage engine had to do crash recovery.) Starting from MySQL version 3.23.48, Windows waits longer for the MySQL server shutdown to complete. If you notice this still is not enough for your installation, it is safest not to run the MySQL server as a service. Instead, run it from the command-line prompt, and shut it down with mysqladmin shutdown.

There is a problem that Windows NT (but not Windows 2000/XP) by default only waits 20 seconds for a service to shut down, and after that kills the service process. You can increase this default by opening the Registry Editor `\winnt\system32\regedt32.exe' and editing the value of WaitToKillServiceTimeout at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control in the Registry tree. Specify the new larger value in milliseconds (for example, 120000 to have Windows NT wait up to 120 seconds).

Please note that when run as a service, mysqld has no access to a console and so no messages can be seen. Errors can be checked in the error log, which is located in the `C:\mysql\data' directory. It is the file with a suffix of `.err'.

If you have problems installing mysqld as a service using just the server name, try installing it using its full pathname:

shell> C:\mysql\bin\mysqld --install

If that doesn't work, you can get mysqld to start properly by fixing the path in the registry!

If you don't want to start mysqld as a service, you can start it from the command line the same way as for Windows 95, 98, or Me. For instructions, see section 2.6.1.1 Starting MySQL on Windows 95, 98, or Me.

User Comments

Posted by [name withheld] on Sunday July 28 2002, @3:50pm[Delete] [Edit]

I too had the 1067 error. I wanted to have mysql
installed on my E: drive (my OS, WinXP, resides on
the C:\ drive, but I wanted all my web server stuff
to be on E:\ ). After seeing that I couldn't get the
service to start, I tried creating a my.ini file and
sticking it in C:\Windows, but this didn't solve the
problem. To correct it, I uninstalled mysql as a
service, uninstalled mysql as a program and deleted
the my.ini file. I then reinstalled the mysql program.
Re-created the my.ini file, and then installed mysql
as a service (in that order). It seems to have taken
care of the problem.

Posted by [name withheld] on Thursday May 30 2002, @7:12am[Delete] [Edit]

"HOW I FIXED THE 10061 error on XP: the easy way.
I installed mysql on my new win XP laptop, and
then went to the command line and tried to run it
and got ERROR 2003: can't connect to MySQL server
on 'localhost' How I fixed it: I ran
winmysqladmin.exe to see if it would work, and it
asked me to choose a username and password to
create my.ini. Interestingly, before this, I had
searched for my.ini and couldn't find it). So I
entered a username and password (made them up),
and hit OK, and it closed. Then I ran
winmysqladmin again, and it worked. Then I ran
mysql from the command line and it worked. "

I am having the same error 2003 problem with
NT...will the XP solution work on NT as well?

Posted by mike.rogers on Tuesday January 29 2002, @8:30am[Delete] [Edit]

The answer is to install in c:\mysql (the default
location) installing in c:\program files\mysql
(where we'd like to put it) seems to result in
the error 1067 problem, although having said that
I have managed to install it in program files on
one machine without any problems (although I
can't remember how I fixed it)

Posted by [name withheld] on Tuesday January 29 2002, @8:30am[Delete] [Edit]

If the service fails to start under Windows NT
then the chances are you have installed the mySQL
server into a different directory than the
default. (e.g. c:\program files\mySQL)

If this is the case you need to do two things:
1. create a c:\winnt\my.ini file which details
where the mySQL apps & data resides (see help
elsewhere)
2. copy the "mysql" subdirectory from the
~\mysql\data directory to where you have
specified the data will reside.

Always find and read the mysql.err file - it
should tell you what is going wrong :-)

Posted by Peter Schumacher on Tuesday January 29 2002, @8:30am[Delete] [Edit]

I had the exact same problem.

Suddenly I was unable to start the MySQL service.

I retraced my actions and the only thing I had
done was to launch WinMySQLadmin.

I looked at the my.ini located in C:\winnt and
realized that it only contained an entry for
WinMySQLadmin.

It seemed as if WinMySQLadmin had overwritten my
regular configuration.

I looked at c:\ where a backup of my.cnf
(my_cnf.bak) is kept, added the contents to
c:\winnt\my.ini and everything worked again.

Hope it helps...

Posted by Sean Porter on Tuesday January 29 2002, @8:30am[Delete] [Edit]

I was also having problems getting mySQL to start
on my windows 2000 Professional system. Then the
last comment in the list, by Peter Schumacher
made me realize that I had started the
WinmySQLadmin and that created a my.ini that was
interfering with starting mySQL. I just deleted
the my.ini file entirely and I was able to start
mySQL with no problems. Deleting the file may
not be the best way to go, but it worked for me.
BTW, I'm a complete newbie to all of this. I
have never worked with anything but Access. If I
can figure it out, anyone can!!!

Posted by Pino Polio on Tuesday January 29 2002, @8:30am[Delete] [Edit]

Sean Porter is totally right. Just delete the
my.ini file from the WINNT folder and MySQL is
running.

Posted by [name withheld] on Tuesday January 29 2002, @8:30am[Delete] [Edit]

I have also had problems getting mySQL to start.
I can't install on c:\mySQL due to size limits.
installing on d:\program files\mySQL will not
qork (i get an error 193(not a valid NT
application)) I assumed it was the space so tried
putting d:\progra~1\mySQL into the my.cfg file to
no avail. I was able to get it up and running
when installed on d:/mySQL if configured using
c:\winnt\my.ini. I got an error 1067 if I put
the same file as c:\my.cfg.

Posted by Gilles Levreau on Thursday July 25 2002, @10:31am[Delete] [Edit]

How I fixed my 1067 error on Win2K: I have not
installed mysql in the default directory, and when
I started it as a service I had the dreaded 1067
error, even though I had set the basedir and
datadir options in the C:\my.cnf file. I turned
out what I thought was my.cnf was instead
my.cnf.cnf. My Win2K install associates .cnf with
SpeedDial, and Explorer hides the .cnf, even
though I've turned off the option 'Do not show
hidden files and folders'. So when I copied
my-medium.cnf to C:\ I added .cnf to the one I
didn't see. Once I removed the extra one it worked
fine. (doing a DIR on the file shows the
extension, though).

PS: starting mysqld with no options still doesn't
work. It should start mysqld as a service but
instead I get the 1067 error. Debugging mysqld
shows that the call to
StartServiceCtrlDispatcher() returns
ERROR_FAILED_SERVICE_CONTROLLER_CONNECT, which
means "The service process could not connect to
the service controller", for whatever reason
(starting it from the service controller works fine).

Posted by [name withheld] on Tuesday January 29 2002, @8:30am[Delete] [Edit]

Well, for Windows XP users, we cannot start
mySQL the conventional way like what we used to
do in Windows 2000 or previous NT versions
(\mysql\bin\mysqld-nt.exe --install). The only
solution I could give is to run
WinMySQLAdmin.exe. It will run the daemon mysqld-
nt as a service. Hope this helps.

Posted by [name withheld] on Tuesday January 29 2002, @8:30am[Delete] [Edit]

I just installed it on XP pro. as a service
(c:\mysql\bin\mysqld-max-nt --install) no
problems
encountered. running mysql-3.23.47-win

Posted by [name withheld] on Tuesday January 29 2002, @9:00am[Delete] [Edit]

I have installed mysql-3.23.47 on XP. If I try
to intall the service through mysqld-nt --
install or mysqld-max-nt --install, MySql
service gets intalled but still gives the error
(1067) when I start the service. As mentioned in
previous comments to remove my.ini file doesn't
work or making any changes to my.ini do any
effects. Also, after starting mysqld, when I try
to do mysql, I get the error "ERROR 2003: Can't
connect to MySQL server on 'localhost'
(10061)". I do not get ERROR 2003 only if I do
mysqld-max-nt --standalone.

Posted by Syke O'Path on Tuesday January 29 2002, @3:48pm[Delete] [Edit]

Well, I've installed MySQL on about 20 W2K ADV
Servers, and have not had one problem.. wait,
no, I lie.

On a few of the servers I wanted to use mysql-max-
nt instead of mysql-nt(default)and had to play
with the my.ini to correct it.. then had to
totally unload the server. Then I had to close
winmysqladmin. When I reopened it, it restarted
the server, used the modified my.ini, and worked
fine.

All other installs have functioned just fine. If
there are problems on your W2K installation, I
suggest you check the policy settings for local
policies, or check the domain policies if you are
part of a domain.

Posted by [name withheld] on Wednesday January 30 2002, @3:37am[Delete] [Edit]

This worked for me on Windows 2000.
Create an my.ini in c:\WINNT
Add the following contents, assuming you
installed into c:\mysql

[mysqld]
basedir=c:/mysql
datadir=c:/mysql/data

save and restart and hopefully all should be fine)

Posted by Jim Dam on Saturday February 2 2002, @6:51pm[Delete] [Edit]

This may seem very obvious to some, but I have
previously installed on Windows XP Professional,
and have just installed on Windows XP Home, and
didn't at first realize that when I renamed a
file to my.ini or my.cnf, since I had not turned
off "Hide known file extensions", I was actually
renaming it to my.ini.txt and my.cnf.txt. Once
I turned off "Hide known file extensions", I
could NET START MYSQL and it worked perfectly
(before it was giving me error 1067).

Posted by gochi on Wednesday December 18 2002, @5:27pm[Delete] [Edit]

About the terrible ERROR 1067 in Windows XP :)

Your my.ini file should contain this:

[mysqld]
basedir=C:/yourInstallDir/mysql
datadir=C:/yourDataDir/data

[WinMySQLAdmin]
Server=C:/yourInstallDir/mysql/bin/mysqld-nt.exe

Be careful with the slashes!
Now you can start mysql service from Services
window.
Everything works perfectly with my XP.

Posted by [name withheld] on Tuesday May 21 2002, @9:52am[Delete] [Edit]

I'm running mysqld-max-nt on WinXP using InnoDB
tables. I'm running version 4.0.1. I was
running into the 1067 error as a
service too. This only happened if my log files
were on a different system. What I did to fix
the problem was the following...
1. In the my.ini file, I changed the path to the
log files from using a mapped drive letter to
using UNC. (\\server\\user\\path...)
2. In the Services Control Panel, I changed to
logon from the system to a domain user for the
share I'm keeping the logs on.
I hope this helps someone out there. It may just
be a special case, but I discovered it by playing
around for a few hours.

Posted by Stephen S on Wednesday December 18 2002, @5:27pm[Delete] [Edit]

MySQL is not as cryptic as you might be first
led to believe. When it reports error 1067,
etc... just visit the mysql.err file in your
data folder (see your my.ini or my.cnf file for
this location). This is where MySQL puts error
messages so you can figure out what is wrong.
In the case of code 1067, basically it is
complaining that it can't find the mysql
database. MySQL stores user grant tables and
other administrative information in
database "mysql". So most likely what you have
done is set your data path to be other than the
default c:\mysql\data. In order to do this, you
also need to copy the contents of c:\mysql\data
to the non-default location you have specified
in your my.ini or my.cnf file.

I definitely think this should be stated more
clearly in the manual for specifying a non-
default data directory. This problem happened
to me as well. C drive? what is that in Windows
XP? the darn OS decided it was installing
itself on G drive and I had no say so. doh.

Posted by [name withheld] on Sunday February 24 2002, @2:03am[Delete] [Edit]

Re: 1067 error after having started
winmysqladmin, check for existence of c\:my.cnf,
if not present restore using my_cnf.bak worked
for me also.

Posted by [name withheld] on Thursday May 23 2002, @2:10pm[Delete] [Edit]

Running Version 3.23.39 as SERVICE on W2K
Advanced Server and got error 1067. Problem
solved by adding group SYSTEM with "read &
Exec..", "List Fold.." and "Read" rights to the
under datadir= specified directory. (Everyone
works too but it's not what I am after)

Posted by [name withheld] on Tuesday March 12 2002, @9:59am[Delete] [Edit]

I had trouble with setting up the service and
the standalone server on Windows XP. The issue
seems to me to be a bug in mysql with comments
on the same line as data in the configuration
file.

I wrote this and it didn't work:

datadir=f:/mysql/data # don't include
comments here.

I corrected the statement by removing the
comment:

datadir=f:/mysql/data

Then everything started working for me.

Posted by [name withheld] on Wednesday April 3 2002, @5:19am[Delete] [Edit]

For everyone with problem 1067:
If you want to have your MySQL in C:\Program
Files\MySQL add following line to \WinNT\my.ini
(after copy it from examples):
[mysqld]
basedir=C:/Program Files/MySQL/
^^^^^ Remember about slashes.
After it service should be working:
bin/mysqld-max-nt --install
net start mysql

Posted by [name withheld] on Sunday April 7 2002, @9:54am[Delete] [Edit]

HOW I FIXED THE 10061 error on XP: the easy way.

I installed mysql on my new win XP laptop, and
then went to the command line and tried to run
it and got

ERROR 2003: can't connect to MySQL server
on 'localhost'

How I fixed it:

I ran winmysqladmin.exe to see if it would work,
and it asked me to choose a username and
password to create my.ini. Interestingly, before
this, I had searched for my.ini and couldn't
find it).

So I entered a username and password (made them
up), and hit OK, and it closed. Then I ran
winmysqladmin again, and it worked. Then I ran
mysql from the command line and it worked.

Posted by Don Verhagen on Wednesday December 18 2002, @5:28pm[Delete] [Edit]

All the above hits about changing the my.ini and
forward slashes verus backward slahes were
absolutely execellent. I have MySQL running under
program files and the data directory on another
partition (D:).

Thanks!


my.ini file under C:\WinNT
[mysqld]
basedir = c:/Program Files/MySQL
datadir = d:/MySQL/data

skip-innodb

[client_fltk]
help_file= c:/Program
Files/mysql/sql_client/MySQL.help
client_file= c:/Program
Files/mysql/MySQL.options
history_length=20
database = test
queries_root= c:/Program Files/mysql/queries
last_database_file= c:/Program
Files/mysql/lastdb

[WinMySQLAdmin]
Server = C:/Program Files/MySQL/bin/mysqld-max-
nt.exe

Posted by [name withheld] on Friday June 7 2002, @11:28am[Delete] [Edit]

Just a note about a strange occurrence in case
anyone else experiences this:
winmysqladmin on W2K caused the mysql service to
freeze on non-admin user accounts. Strangely
enough, a quick port check shows the mysql as
active and listening but no connections can be
made EXCEPT when you are logged in as admin. For
the non-admin accounts on this machine, even
though the port check looks OK, if you go to the
services console it will show the service as
stopped, and you will not be able to start it
(and winmysqladmin will ask if you want to
install the service). Upon removing
winmysqladmin from startup (all users) the MySQL
service functioned normally for ALL user accounts
on this machine.

Posted by Barré Lionel on Wednesday December 18 2002, @5:27pm[Delete] [Edit]

About the "System error 1067 has occurred" with
Windows OS and install in "non-standard" folder
(other than c:\mysql)
A good idee : Look on the C:\ Root and open the
"NULL" fille. There is all informations when MySQL
does not start correctly : error 1067
A regular error is "The system cannot find the
specified folder"
I thinks that's a good tips
Lionel

Posted by [name withheld] on Thursday August 22 2002, @11:05am[Delete] [Edit]

I wasted so many hours and hundred of curses before finally getting mysqld-max-nt.exe up running without the infamous 1067 System error for Windows 2000, whoever screwed up the my-[size].cnf files in <installDir> is deserved to be lynched for being deceitful, the innodb parameters setting between Win?? and NT/2000 may be different. The innodb parameters was updated on my Windows 2000 to:

innodb_data_file_path = /ibdata1:300M:autoextend<CR>

innodb_data_home_dir = c:/ibdata <CR>

innodb_log_group_home_dir = c:/iblogs <CR>

innodb_log_arch_dir = c:/iblogs <CR>.

Before my updates, the parameters in the default .cnf files were using c:\ibdata and so on, it may be tested on Win98 etc., but they are not acceptable for W2K. (I haven't tested other possible combinations, there may be other options that will work also)

It may be best to use comments and separate sections for different platforms even within the mysql-max-[version]-win.zip. Hope this will save future first time users of mysql some valuable time and frustrations.

Posted by Laurent Denanot on Wednesday December 18 2002, @5:29pm[Delete] [Edit]

Concerning "Error 1067" while attempting to start
the MySQL service previously installed through
the <code>mysqld-nt-max --install</code>
command on Windows
NT/2000:

I experienced this error myself on my first installation
of MySQL, v3.23.52. In my case, I chose to install
MySQL to a particular folder on my
drive (<code>C:/Dev/MySQL323</code>) instead
of the standard location
(<code>C:/MySQL</code>). I then created a
simple
<code>C:/WINNT/MY.INI</code> config file, tried
to start the service and got a 1067 error. After a bit
of troubleshooting I eventually traced the cause of
this error -- I simply forgot to specify
the MySQL base directory through the
<code>basedir</code> key in the
<code>C:/WINNT/my.ini</code>
config file. This setting is mandatory if you install
MySQL to a folder other than the default
(<code>C:/MySQL</code>). In this case you also
have to specify the data directory through the
<code>datadir</code> key

Below is a copy of the (correct) bare bones config
file I use
(<code>c:/winnt/my.ini</code>) --
it only contains the minimal set of entries to get
you going. Note that I am using the "Max" version of
MySQL since I want transaction support, and
therefore I also have to enable support for InnoDB
tables. To achieve this, the documentation says you
only need to specify the
<code>innodb_data_file_path</code> key;
However I found that in addition to setting this, you
also must specify the
<code>innodb_data_home_dir</code> key:

<code>
[mysqld]
basedir = C:/Dev/MySQL323
datadir = C:/Dev/MySQL323/data
innodb_data_home_dir =
C:/Dev/MySQL323/data
innodb_data_file_path =
ibdata1:16M:autoextend

[WinMySQLAdmin]
Server =
C:/Dev/MySQL323/bin/mysqld-max-nt.exe

</code>
Hope this may help some of you out there !!

Posted by Anderson Silva on Tuesday October 1 2002, @4:29am[Delete] [Edit]

Instalei o mysql em uma rede interna com várias
máquinas, de diferentes Sistemas operacionais,
administrado por um servidor Win 2000. A
instalação é simples, como em Win 98. Para iniciar o
servidor, basta executar o arquivo MYSQLD-
NT.EXE. Agora, se quiser que o próprio
adminstrador WINMYSQLADMIN selecione o melhor
servidor windows, basta executar o mesmo, e
pronto.

: O Mysql é legal, mas entender sua lógica é um
pouco complicado. Todas as complicações eu
enfrentei, como todos, e superei. Se alguém tiver
dúvidas, fique à vontade em entrar em contato
comigo. Terei prazer em ajudar.

Posted by Allan brallan on Saturday November 2 2002, @10:58pm[Delete] [Edit]

Help me solve this ERROR?

"The procedure entry point Create
Toolhelp32Snapshot could not be locaded in the
dynammic link library KERNEL32DLL"

What a h...is this.
The error accures when i click on winmysqladmin. I
have no my.ini and no my.cnf and its not installed as
an service.
I maked a Typicall Install.
I have used MySql for several years whitout errors
before. Hlp, I need somebodys help?

Posted by William Wegerson on Thursday November 7 2002, @9:03am[Delete] [Edit]

On XP when I was trying to start the service from
the services window, it would not start. Upon doing
a properties on the service the information gleened
told me XP thought that the exe lived at: C:\mysqld-
max-nt and not in the directory I had placed it in. By
copying the exe to the root of c:\ it worked. Note I
have my XP environment with a path to the bin
directory of mysql.

Posted by [name withheld] on Friday November 15 2002, @2:41am[Delete] [Edit]

I had same problem about
CreateToolhelp32Snapshot Function and i had found
this documentation:

CreateToolhelp32Snapshot Function

Declare Function CreateToolhelp32Snapshot
Lib "kernel32.dll" (ByVal dwFlags As Long, ByVal
th32ProcessID As Long) As Long

Platforms

Windows 95: Supported.
Windows 98: Supported.
Windows NT: Not Supported.
Windows 2000: Supported.
Windows CE: Not Supported.



DAMN !!!!!!!
it's always M$ & WINBUG !

Posted by Guenter Kukkukk on Thursday November 21 2002, @5:52pm[Delete] [Edit]

The CreateToolhelp32Snapshot problem with
winmysqladmin.exe.
Using the MS-Tool DEPENDS.EXE on a system
running WinNT4.0 SP6a it can be seen that at least
the latest mySQL-build 3.23.53
contains a version of WinMySqlAdmin.exe which has
external references to
- CreateToolhelp32Snapshot
- Process32First
- Process32Next
in kernel32.dll, which cannot be resolved on
WinNT4.0 SP6a!

Testing the same with my currently installed mySQL-
version 3.23.47, these external references are
missing.
So that version runs fine on WinNT4.0!
On the Microsoft support page
http://support.microsoft.com/default.aspx?
scid=KB;en-us;q175030
one can read in section
"Using the ToolHelp32 Library to Enumerate
Processes"
that these API-calls are NOT supported on Windows
NT 4.0!
So I will try to inform the mySQL-developers...

Posted by Michael on Wednesday December 18 2002, @5:27pm[Delete] [Edit]

How I fixed my 1067 error on Win2K: I tried all sorts


- reinstalling, upgrading, Service Pack 3, and so on


and so on. I could get it to run as a standalone but


not as a service. When trying to run as a service the


error message I got was "Error 1058: The service


cannot be started, either because it is disabled or


because it has no enabled devices associated with


it.". Finally found out that this could be fixed by the


following (from somewhere else):-





On Windows 2000:


Rightmouse click on the My Computer icon on the


Windows Desktop.


Click on Manage(which brings up the Computer


Management information).


Double click on Services and applications.


Double click on Services.


Double click on the MySql icon.


If the Startup Type shows Disabled, change it to be


either Manual or Automatic.


Click on the Startbutton.


If you get the same error, then try the following


steps:


On Windows 2000, in the same Windows 2000


Services area described earlier:


Double click the MySql icon.


Click the Log On tab.


Verify that the service has not been disabled for the


hardware profile that you're using. If it has, single


click on it, click the Enable button, and then click the


Apply button.


Click the General tab.


Click the Start button.


(Probably obvious if you know about this stuff - but I
didn't!)

Posted by Thomas Johnson on Tuesday January 14 2003, @9:05pm[Delete] [Edit]

System 1067 error. I wanted to have mysql
installed on my D: drive (my OS, Win2000, resides on
the C:\ drive. After seeing that I couldn't get the
service to start, I tried creating a my.ini file and
sticking it in C:\Winnt, but this didn't solve the
problem. To correct it, I uninstalled mysql as a
service, uninstalled mysql as a program and deleted
the my.ini file. Re-created the my.ini file in Winnt.
Reinstalled the mysql program. Then installed mysql
as a service (in that order). It corrected all the
problems that I was having.

Posted by slim186 on Friday January 17 2003, @3:11pm[Delete] [Edit]

After having my onw error 1067 problem and reading other comments on this page, I have come to the conclusion that starting WinMySQLAdmin BEFORE getting the service running is what screws up so many people. In the installation instructions is says something like: "If you are using WinMySQLAdmin this is done automatically, so you can skip the next sections" This makes people think "Hey, I can just start this WinAdmin thing and not have to worry about configuring it manually." So, in brief: IGNORE what the manual says about WinMySQLAdmin, and get MySQL running from the command line first!

Posted by Alberto Trentadue on Monday January 20 2003, @2:08pm[Delete] [Edit]

Had the Error 1067 on Win2K Pro.
It was InnoDb settings. Seems to me that the only way is to let the innodb_data_home_dir setting empty.
This solved the problem:
# innodb_data_home_dir = D:/mysql/ibdata
innodb_data_home_dir =
innodb_data_file_path = /ibdata1:64M:autoextend
innodb_log_group_home_dir = D:/mysql/iblogs
innodb_log_arch_dir = D:/mysql/iblogs
So MySQL runs also outside C:\mysql.
Be sure to read the mysql.err to solve operation problems.

Posted by socelvtars on Wednesday January 22 2003, @11:12am[Delete] [Edit]

I had an error (1067) on Win XP when I installed it on my D: drive. My way of fixing: Don't use winmysqladmin.exe! I just create a my.ini file (c:\windows\my.ini) with this content:
[mysqld]
basedir=D:/mysql
datadir=D:/mysql/data

Posted by [name withheld] on Sunday February 9 2003, @12:38am[Delete] [Edit]

I am php developer and just installed Windows XP Professional. I got stuck when I tried to install mysql. Thanks to the users posts here I got it to work by this 'formula'.
1. Installed mysql under c:\program files\mysql
2. Opened command prompt and typed in the following
"C:\program files\mysql\bin\mysqld-max-nt" --install
3. Edited my.ini under c:\windows and typed in the following:
[mysqld]
basedir=C:/program files/mysql/
datadir=C:/program files/mysql/data/
4. Ran services under control panel and started mysql.

Hope this will help!

Posted by [name withheld] on Monday February 17 2003, @3:49pm[Delete] [Edit]

For everyone on Win 2000 with problem 1067:
I discovered that the path statements MUST be correct.
A simple C:\WINNT\My.ini file should read something like this:
[mysqld]
basedir=D:(or C,E,F)/Program Files/mysql
datadir=D:(or C,E,F)/Program Files/mysql/data

[WinMySQLAdmin]
Server=D:/Program Files/MYSQL/bin/mysqld-nt.exe

If you want to use the command line with this path, go to \progra~1\mysql\bin. Lines 4 & 5 are added automatically by running winmysqladmin from the .../bin directory.

Posted by johnbarker on Tuesday February 25 2003, @8:59am[Delete] [Edit]

Hi,
I had the error 1067 error whilst installing mysql to another directory on WINDOWS NT service pack 6 as a service.

I created a my.ini file in the c:\winnt directory and put my basedir & datadir in. At first this still didn't work until I came across the simple reason I had left this top line out. one this was in the sevice started no problems.

[mysqld] ***This line is important to the ini file and cost me a few hours and grey hairs realising that it was needed***

basedir = C:/Dev/MySQL323
datadir = C:/Dev/MySQL323/data

Posted by Shelley on Tuesday February 25 2003, @7:03pm[Delete] [Edit]

Thanks to Jim Dam's posting, his fix worked for me!
I'm running Windows 2000 Professional and currently learning myPHPAdmin and MySQL. In my case, I'm toying with PHP_Triad which is bundled free package that provides mySQL and PHPadmin so I can test on my box. It didn't put my.ini file so following Jim's posting, it worked. My only change was to direct to c:/apache/mysql instead.

Thanks!
S
***************************************
This worked for me on Windows 2000.
Create an my.ini in c:\WINNT
Add the following contents, assuming you
installed into c:\mysql

[mysqld]
basedir=c:/mysql
datadir=c:/mysql/data

save and restart and hopefully all should be fine)

Posted by Jim Dam on Saturday February 2 2002, @6:51pm
***********************************************

Posted by Fatih Olcer on Thursday March 13 2003, @11:36am[Delete] [Edit]

READ THE INFORMATION WINDOW WHILE INSTALLING MYSQL
(THE SECOND DIALOG !)

IT S TELLING WHAT TO DO IF YOU DONT WANT TO INTALL
TO THE DEFAULT MYSQL PATH

Posted by khuntan on Friday April 4 2003, @5:00am[Delete] [Edit]

I've just got hint from the above comment and then I successfully installed 4.0.12 along with the installed MySQL 3.23.

Simple instruction:
1. run 'mysqld-max-nt --install mysql4"
2. copy the 'mysqld' section and paste into \winnt\my.ini just below the end of [mysqld] section. Then change anything your want, ie. bind-address, basedir, datadir. Change the copied section name from 'mysqld' to 'mysql4' or anything you named it at first step.

I wasted almost a day for the answer of this #1067 error. Hope the instruction should be added to MySql manual in the future.

Posted by [name withheld] on Friday April 4 2003, @10:09am[Delete] [Edit]

I cannot create a database using winmysqladmin. the only thing i can figure is where it says ODBC it used to say NOT FOUND, then i installed myodbc, now it says NOT FOUND, and below it lists the drivers...(?)

i'd like to get rid of the "not found" part, but not sure how. anybody know about this?

Posted by Cristian Amarie on Tuesday April 15 2003, @10:54pm[Delete] [Edit]

I just downloaded the source code tree and, browsing the comments, I see may Windows users stuck into 1067 ("The process terminated unexpectedly.") error, others having trouble with Toolhelp library and so on.

I' m not starting a war here, but I'd like to point some things about Windows NT services:

A. (For MySQL team)
A service relying on .ini file(s) use should be discouraged.
Services should rely on registry settings.

The simplest error we can get here is to install MySQL on disk D: and to have MySQL.ini or whatever on disk C: (suppose on C:\WinNT\System32). The service is started under an account that may or may not have rights to read, write, locate etc. the .ini file, especially if is not located in the same tree as the service's executable. Also, editing manually an .ini file can be as cryptic as is to edit manually the registry entry.

B. (For MySQL team)
The best way to install, configure and troubleshoot a service is to provide 3 separate executable tools:

1. the (un)installation utility (can be supplied by the service executable itself - but I don't recommend this since we want our service small and less dependent on various APIs and libraries);
2. the service (+ additional libraries and files) itself;
3. the configuration/troubleshoot utility (a good candidate for a Control Panel applet, but not necessarily).
I don't know (yet) if MySQL service does this, but it seems not (or at least not entirely) since many users have to edit manually an .ini file.

C. (For Windows users/developers)
Take care of various process helper APIs and their availability of various platforms.

There are some examples in almost any MSDN describing various techniques about process and thread handling. Since the executive are very different among various Windows platforms, one platform may use Toolhelp shapshots library, other PSAPI library, other ca rely on performance counters and so on. The SCM concept is very different as well (there is no SCM on Windows 9x, at least what is on NT platforms), but 9x Kernel32.dll exports RegisterServiceProcess (unavailable on NT), uses other registry keys and so on.

And, finally, about the 1067 error: this error (as any other error) should clearly record in Event log the cause of error, not just 'The service terminated unexpectedly. It has done this for x times' etc. A more accurate desciption into raw strings event log record, as 'The service could not read initialization parameters', 'The attempt to locate system databases failed.' and so on can provide valuable informations about the failure point and (perhaps) suggesting repair informations (hyperlinks to MySQL FAQ and error database, and so on).

Posted by Samuel Davis on Wednesday April 16 2003, @7:31pm[Delete] [Edit]

I was having the 1067 error on windows xp with every thing installed in the default directory. I fixed my by checking the box labeled allow serive to interact with desktop under the log on tab under the service properties.

Posted by Thomas Hill on Thursday April 24 2003, @11:04am[Delete] [Edit]

I just installed 4.0.12 on W2K, not on C:\mysql.

After the install, I copied the my-medium.cnf file to c:\WINNT\my.ini, changing the basedir and the datadir paths. The datadir was completely separate from basedir.

When I started mysqld (with or without -nt), it bailed out and the log said it couldn't find mysql.host. I created the file everywhere and still had no success. And I tried a bunch of other stuff.

What eventually worked was:

I deleted my datadir directory (mine, as pointed to by the datadir in the my.ini, not the one under basedir). Then I tar'ed up the data directory under basedir and untar'ed it where datadir was pointing.

Voila. Works like a champ now.

Posted by Thomas Hill on Thursday April 24 2003, @11:36am[Delete] [Edit]

The 1067 error when starting it as a service went away for me, when I:

-- left my c:\winnt\my.ini as is (pointing to a non-standard basedir and datadir - f:/mysql/installed and f:/mysql/data)

-- in explorer right-clicked on my data directory, Properties, Security, Add, selected SYSTEM, Add, OK, selected SYSTEM, granted Full Control, OK.

-- started the service under Settings -- Control Panel -- Adminstrative Tools -- Services.



Somebody mentioned this already. Just confirming it worked for me, with additional clarification how to do it, and that it is ALL you need to do.

Posted by Felix Lennemann on Sunday April 27 2003, @1:35pm[Delete] [Edit]

I have one Problem: first came the error "ODBC Driver 3.51 not found". Then I installed the driver and now only this error msg came:

not found

driver information of the ODBC driver...

plz help me an answer to webmaster@sid0r.de

thanks!

Posted by kayec on Monday April 28 2003, @4:22pm[Delete] [Edit]

ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)

Check your personal firewall!

Posted by James Crutchfield on Thursday May 1 2003, @2:58am[Delete] [Edit]

I was able to fix the error 10061 issue on Windows 2000 Advanced Server by following the exact procedure listed in the Windows XP fix at/near the start of these comments. Thanks very much!

Posted by Patrick Mulligan on Tuesday May 6 2003, @5:53pm[Delete] [Edit]

THIS POST ABOVE WORKED - I WAS ABLE TO START VIA SERVICE MANAGER RIGHT AFTER - SMALL INSTALL BUG

This worked for me on Windows 2000.
Create an my.ini in c:\WINNT
Add the following contents, assuming you
installed into c:\mysql

[mysqld]
basedir=c:/mysql
datadir=c:/mysql/data

save and restart and hopefully all should be fine)

Posted by [name withheld] on Thursday May 8 2003, @11:59pm[Delete] [Edit]

i followed readme.txt instructions to install 4.1.0alpha on an XPpro laptop over a previous 3.23installation.
i got the same 1067 error becouse i forgot to move previous datafiles out of the DATA folder.
It seemed quite a matter of grants. I simply:
-moved out old data files (MYD, FRM, etc),
-copied unzipped mysql binaries into the C:\mysql
-installed the service (mysqld-xx --install) and so on
-ran the service (net start mysql)
-everything went right
-copied old data files back into the data dir
-suddenly mysql recognized the databases and everything work fine

I know it's a hardly empiric manner to solve it but it worked (it's not a production server, just a testing one)

Posted by [name withheld] on Saturday May 10 2003, @7:09pm[Delete] [Edit]

I too was getting 1067 errors, but from a different
sort. The data/<hostname>.err file said:

030510 19:00:41 InnoDB: Operating system error number 5 in a file operation.
InnoDB: See http://www.innodb.com/ibman.html for installation help.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory. It may also be you have created a subdirectory
InnoDB: of the same name as a data file.
InnoDB: File name c:\mysql\iblogs\ib_logfile0
InnoDB: Cannot continue operation.

Curiously enough, I could start the database manually,
but not as a service.

Investigating, it turned out that the security
information on the innodb directories were not set
correctly -- System did not have access to them. It
appears that mysql tried to grant itself permissions,
but it had done so incorrectly (user "None" was listed,
and the permissions were no longer inherited from
the parent).

Removing the special permissions, and restoring the
normal inherited permissions cured the problem.

This was on Windows XP Pro, SP1

Posted by Mike Gilbert on Saturday May 24 2003, @12:40am[Delete] [Edit]

Responding to the post on Friday April 4 2003, @10:09am, I am having the same problem. I have run MySQL on WinXP before, but I am unable to create new databases. when I right click I only get "Flush" options. Can anyone shed some light here? Thanks!

Posted by [name withheld] on Saturday May 31 2003, @10:40pm[Delete] [Edit]

This is aggravating. I am installing this locally, and setting the proper directories to be writable, but XP keeps restoring them to read-only. Could this be the source of my problem?

Posted by Steven Casey on Monday June 9 2003, @9:05pm[Delete] [Edit]

if after rebooting on Win2K or NT, you get the following when starting the service: Error 193 %1 is Not a Valid Win32 Application, use regedit and navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<serviceName> Double click ImagePathvalue and encapsulate the value in double quotes.

Restart the service

Posted by Lavinia Elena Raducan on Monday June 23 2003, @8:51am[Delete] [Edit]

I got the same 1067 error as I installed mysql on d. I copied the libmysql.dll in d:\\mysql\bin and it worked.

Posted by Mike Gerber on Monday July 7 2003, @3:40am[Delete] [Edit]

I installed MySQL 4.0.13 on Windows XP Pro I installed it fine get no errors starting up but everytime I try to connect to it, it won't connect to it. Any ideas?

Posted by Tayden Miller on Friday August 1 2003, @6:30pm[Delete] [Edit]

I had an error recently where winmysqladmin.exe was requesting a dll file that it couldnt find. This also seemed to make mysqladmin.exe refuse to connect to my server. To fix it I just copied the dll it requested (located in mysql\lib\opt) and put it in the same folder as mysqladmin/sqladmin .exe and ran it. Created its own default My.ini and fixed all my errors. My error numbers included 1067, 10061, and 2003. I think those err #'s are correct, just going off memory. Happy SQL'ing!

Posted by [name withheld] on Sunday August 10 2003, @10:33am[Delete] [Edit]

I just have meet the same problem about 2003.
when i use MYSQL in command line to connect to the mysql server, it report:

"ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)".

so, i didn't use the default connect settings 'localhost',but use the Computer's IP address(Computer name as well) to point the connection host.
Such as:
mysql -h 192.168.0.3 -u root

then, it connect to the server successfully.
After change the 'localhost' to IP or ComputerName, I use Mysql_Front to connect server very well.

Add your own comment.