Error 1067 when starting as service, no problem in standalone

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kevin D.

    Error 1067 when starting as service, no problem in standalone

    Please note, I already posted this on the MySQL official forum, but received
    no response. I thought I'd try again in another location. My apologies to
    anyone reading this twice...

    Despite everything I've tried, I cannot get MySQL to start as a Windows
    service. However, I AM able to get it started via the mysqld-nt --console
    command.

    Here is my (funky) setup:

    - MySQL 5.0 on Windows XP SP2 development server
    - datadir in my.ini file set to network path Z:/path/to/mysql/ (note the
    forward slashes)
    - This network drive is actually an external hard drive (via firewire) on my
    workstation PC

    Permissions are set accordingly:
    - User "MyUserAcco unt" exists on BOTH server and workstation (with identical
    passwords)
    - MySQL service is set to run as "MyUserAcco unt"
    - "MyUserAcco unt" has FULL permissions to access the local MySQL basedir and
    the network datadir path

    In short, I can execute:

    mysqld-nt --console (with or without --standalone)

    .... to get the server started. I enter the mysql command line and can see
    all my databases from my network share. I then can verify through Task
    Manager that the mysqld-nt service is running under the "MyUserAcco unt" user
    (this is the default Windows user for my server).

    I shutdown with:

    mysqladmin -u root -p shutdown

    Now I try to start the service using:

    - net start mysql or...
    - Windows Services console

    .... and receive the following error:

    "Could not start the MySQL service on Local Computer.
    Error 1067: The process terminated unexpectedly."

    Checking Windows Event Viewer gives me foggy error messages such as:

    "Aborting" and...
    "The MySQL service terminated unexpectedly. It has done this x time(s)."


    I will gladly provide more information if needed, but I am completely
    stumped at this point. Many thanks to any who can help me out with this.

    - Kevin


  • Bill Karwin

    #2
    Re: Error 1067 when starting as service, no problem in standalone

    "Kevin D." <creepiedecrapp er@gmail.com> wrote in message
    news:4PJFf.5571 0$V.32341@fed1r ead04...[color=blue]
    > "Could not start the MySQL service on Local Computer.
    > Error 1067: The process terminated unexpectedly."
    >
    > Checking Windows Event Viewer gives me foggy error messages such as:
    >
    > "Aborting" and...
    > "The MySQL service terminated unexpectedly. It has done this x time(s)."[/color]

    I find little useful information for MySQL recorded in the Windows Event
    log. You should look in the MySQL server error log for better information.
    This error log can be found under the MySQL data directory, as a filename
    "hostname.e rr" where hostname is the name of your host on which MySQL runs.

    Regards,
    Bill K.


    Comment

    • Kevin D.

      #3
      Re: Error 1067 when starting as service, no problem in standalone

      thanks for the reply!

      that's part of my problem, no hostname.err log file is created since the
      datadir is located on the remote drive which, for some odd reason, mysql
      won't connect to when running as a windows service (yet has no problem
      connecting to it when run in --console --standalone mode)




      "Bill Karwin" <bill@karwin.co m> wrote in message
      news:ds82vh0109 f@enews4.newsgu y.com...[color=blue]
      > "Kevin D." <creepiedecrapp er@gmail.com> wrote in message
      > news:4PJFf.5571 0$V.32341@fed1r ead04...[color=green]
      >> "Could not start the MySQL service on Local Computer.
      >> Error 1067: The process terminated unexpectedly."
      >>
      >> Checking Windows Event Viewer gives me foggy error messages such as:
      >>
      >> "Aborting" and...
      >> "The MySQL service terminated unexpectedly. It has done this x time(s)."[/color]
      >
      > I find little useful information for MySQL recorded in the Windows Event
      > log. You should look in the MySQL server error log for better
      > information. This error log can be found under the MySQL data directory,
      > as a filename "hostname.e rr" where hostname is the name of your host on
      > which MySQL runs.
      >
      > Regards,
      > Bill K.
      >[/color]


      Comment

      • Jonathan

        #4
        Re: Error 1067 when starting as service, no problem in standalone

        Kevin D. wrote:[color=blue]
        > Please note, I already posted this on the MySQL official forum, but received
        > no response. I thought I'd try again in another location. My apologies to
        > anyone reading this twice...
        >
        > Despite everything I've tried, I cannot get MySQL to start as a Windows
        > service. However, I AM able to get it started via the mysqld-nt --console
        > command.
        >
        > Here is my (funky) setup:
        >
        > - MySQL 5.0 on Windows XP SP2 development server
        > - datadir in my.ini file set to network path Z:/path/to/mysql/ (note the
        > forward slashes)
        > - This network drive is actually an external hard drive (via firewire) on my
        > workstation PC
        >
        > Permissions are set accordingly:
        > - User "MyUserAcco unt" exists on BOTH server and workstation (with identical
        > passwords)
        > - MySQL service is set to run as "MyUserAcco unt"
        > - "MyUserAcco unt" has FULL permissions to access the local MySQL basedir and
        > the network datadir path
        >
        > In short, I can execute:
        >
        > mysqld-nt --console (with or without --standalone)
        >
        > ... to get the server started. I enter the mysql command line and can see
        > all my databases from my network share. I then can verify through Task
        > Manager that the mysqld-nt service is running under the "MyUserAcco unt" user
        > (this is the default Windows user for my server).
        >
        > I shutdown with:
        >
        > mysqladmin -u root -p shutdown
        >
        > Now I try to start the service using:
        >
        > - net start mysql or...
        > - Windows Services console
        >
        > ... and receive the following error:
        >
        > "Could not start the MySQL service on Local Computer.
        > Error 1067: The process terminated unexpectedly."
        >
        > Checking Windows Event Viewer gives me foggy error messages such as:
        >
        > "Aborting" and...
        > "The MySQL service terminated unexpectedly. It has done this x time(s)."
        >
        >
        > I will gladly provide more information if needed, but I am completely
        > stumped at this point. Many thanks to any who can help me out with this.
        >
        > - Kevin[/color]

        I had a few services I needed to configure to retrieve data from the
        net... however I would not recommend doing this with MySQL table data.
        Perhaps you can explain on why you have chosen this setup as there might
        be a different, more appropriate way.

        Now to your question. As windows starts it also starts the services,
        this is done before a user is signed in. Drive mappings are user
        dependent and are made when a user logs in, so the drive mappings are
        not available at the time the MySQL service is started. Therefor it
        works when you are logged in and manually start the service, but not
        when you automatically start it before you log in.

        It might work if you don't use the mapped drive but use the full UNC
        path to the datadir, those paths are usually resolved by the DNS and are
        available to windows at the time it starts the services. If you don't
        have DNS or name resolving you might want to use the IP number, so either:

        \\server\path\t o\mysql\datadir

        or

        \\ip-number\path\to\ mysql\datadir

        Good luck, but I am really curious if you really need this setup.

        Jonathan

        Comment

        • Jonathan

          #5
          Re: Error 1067 when starting as service, no problem in standalone

          Kevin D. wrote:[color=blue]
          > thanks for the reply!
          >
          > that's part of my problem, no hostname.err log file is created since the
          > datadir is located on the remote drive which, for some odd reason, mysql
          > won't connect to when running as a windows service (yet has no problem
          > connecting to it when run in --console --standalone mode)
          >
          >
          >
          >
          > "Bill Karwin" <bill@karwin.co m> wrote in message
          > news:ds82vh0109 f@enews4.newsgu y.com...[color=green]
          >> "Kevin D." <creepiedecrapp er@gmail.com> wrote in message
          >> news:4PJFf.5571 0$V.32341@fed1r ead04...[color=darkred]
          >>> "Could not start the MySQL service on Local Computer.
          >>> Error 1067: The process terminated unexpectedly."
          >>>
          >>> Checking Windows Event Viewer gives me foggy error messages such as:
          >>>
          >>> "Aborting" and...
          >>> "The MySQL service terminated unexpectedly. It has done this x time(s)."[/color]
          >> I find little useful information for MySQL recorded in the Windows Event
          >> log. You should look in the MySQL server error log for better
          >> information. This error log can be found under the MySQL data directory,
          >> as a filename "hostname.e rr" where hostname is the name of your host on
          >> which MySQL runs.
          >>
          >> Regards,
          >> Bill K.
          >>[/color][/color]

          Please don't top post the next time, as it messes up the order of the
          conversation, normal order is to post your answers at the bottom or in
          between to keep the logic of a conversation.

          Jonathan

          Comment

          • Bill Karwin

            #6
            Re: Error 1067 when starting as service, no problem in standalone

            "Kevin D." <creepiedecrapp er@gmail.com> wrote in message
            news:XZNFf.5574 2$V.31108@fed1r ead04...[color=blue]
            > thanks for the reply!
            >
            > that's part of my problem, no hostname.err log file is created since the
            > datadir is located on the remote drive which, for some odd reason, mysql
            > won't connect to when running as a windows service (yet has no problem
            > connecting to it when run in --console --standalone mode)[/color]

            That probably explains why MySQL won't start as a service, if its data dir
            is on a remote drive and it doesn't like it. This behavior might be by
            design!

            It's a very bad idea to locate the data dir on a remote drive. If the
            network between your server host and your remote drive host has any hiccup,
            you'll get data corruption. Plus the traffic is transmitted unencrypted.

            Relocate the data dir to a local drive and I think your service startup
            issue will be resolved.
            Use the remote drive only to store database backups, not the live database.

            Regards,
            Bill K.


            Comment

            • Kevin D.

              #7
              Re: Error 1067 when starting as service, no problem in standalone


              "Jonathan" <jonathan@heela l.nl> wrote in message
              news:43e7bb8f$0 $2023$ba620dc5@ text.nova.plane t.nl...[color=blue]
              > Kevin D. wrote:[color=green]
              >> Please note, I already posted this on the MySQL official forum, but
              >> received no response. I thought I'd try again in another location. My
              >> apologies to anyone reading this twice...
              >>
              >> Despite everything I've tried, I cannot get MySQL to start as a Windows
              >> service. However, I AM able to get it started via the mysqld-nt --console
              >> command.
              >>
              >> Here is my (funky) setup:
              >>
              >> - MySQL 5.0 on Windows XP SP2 development server
              >> - datadir in my.ini file set to network path Z:/path/to/mysql/ (note the
              >> forward slashes)
              >> - This network drive is actually an external hard drive (via firewire) on
              >> my workstation PC
              >>
              >> Permissions are set accordingly:
              >> - User "MyUserAcco unt" exists on BOTH server and workstation (with
              >> identical passwords)
              >> - MySQL service is set to run as "MyUserAcco unt"
              >> - "MyUserAcco unt" has FULL permissions to access the local MySQL basedir
              >> and the network datadir path
              >>
              >> In short, I can execute:
              >>
              >> mysqld-nt --console (with or without --standalone)
              >>
              >> ... to get the server started. I enter the mysql command line and can see
              >> all my databases from my network share. I then can verify through Task
              >> Manager that the mysqld-nt service is running under the "MyUserAcco unt"
              >> user (this is the default Windows user for my server).
              >>
              >> I shutdown with:
              >>
              >> mysqladmin -u root -p shutdown
              >>
              >> Now I try to start the service using:
              >>
              >> - net start mysql or...
              >> - Windows Services console
              >>
              >> ... and receive the following error:
              >>
              >> "Could not start the MySQL service on Local Computer.
              >> Error 1067: The process terminated unexpectedly."
              >>
              >> Checking Windows Event Viewer gives me foggy error messages such as:
              >>
              >> "Aborting" and...
              >> "The MySQL service terminated unexpectedly. It has done this x time(s)."
              >>
              >>
              >> I will gladly provide more information if needed, but I am completely
              >> stumped at this point. Many thanks to any who can help me out with this.
              >>
              >> - Kevin[/color]
              >
              > I had a few services I needed to configure to retrieve data from the
              > net... however I would not recommend doing this with MySQL table data.
              > Perhaps you can explain on why you have chosen this setup as there might
              > be a different, more appropriate way.
              >
              > Now to your question. As windows starts it also starts the services, this
              > is done before a user is signed in. Drive mappings are user dependent and
              > are made when a user logs in, so the drive mappings are not available at
              > the time the MySQL service is started. Therefor it works when you are
              > logged in and manually start the service, but not when you automatically
              > start it before you log in.
              >
              > It might work if you don't use the mapped drive but use the full UNC path
              > to the datadir, those paths are usually resolved by the DNS and are
              > available to windows at the time it starts the services. If you don't have
              > DNS or name resolving you might want to use the IP number, so either:
              >
              > \\server\path\t o\mysql\datadir
              >
              > or
              >
              > \\ip-number\path\to\ mysql\datadir
              >
              > Good luck, but I am really curious if you really need this setup.
              >
              > Jonathan[/color]


              that's a good idea to try the full UNC path instead although i don't think
              that's the problem since i am not performing my testing during windows
              startup but only after login and all drives are connected (remember too that
              this network share CAN be used as the mysql datadir when i start mysql via
              'mysqld-nt --console')

              to explain why i want to set it up this way (and i've been quickly changing
              my mind over the last week in order to finally relieve my headaches)...

              my environment is for testing/development only, i'm a web developer working
              from home and i just purchased an old compaq to use as my server (got tired
              of running all the required services on my main workstation, plus i want to
              expose this server to the internet so i can "stage" the websites to my
              clients during development)

              in short, i don't trust the compaq HD for keeping my data since it's quite
              old, etc.

              i currently keep all my development files (everything from photoshop designs
              to html/php files and all mysql tables) on an external hard drive connected
              to my workstation (i then do backups from my external drive down to my
              workstation drive, etc.)

              i like to keep all my development files in a single location for portability
              (in case i need to work remotely i just bring the drive) and ease of backup,
              etc.

              at this point i am willing to keep trying this configuration but it seems to
              make more sense to just move the datadir to the same physical drive as my
              mysql basedir (this has been tested and does work, btw) and perform nightly
              dumps to my external drive via the network share

              now i'm wondering, is it also a bad idea to run apache on my server and have
              its document root set to this external drive too?

              sorry for being long-winded (and for top-posting earlier)... hope this gives
              everyone some more insight

              - kevin



              Comment

              • Bill Karwin

                #8
                Re: Error 1067 when starting as service, no problem in standalone

                "Kevin D." <creepiedecrapp er@gmail.com> wrote in message
                news:%vPFf.5574 9$V.12616@fed1r ead04...[color=blue]
                > my environment is for testing/development only, i'm a web developer
                > working from home and i just purchased an old compaq to use as my server[/color]
                . . .[color=blue]
                > in short, i don't trust the compaq HD for keeping my data since it's quite
                > old, etc.[/color]

                If you have doubts about the stability of the hard drive in the Compaq, it's
                a pretty inexpensive task to replace the drive. Or replace the whole
                machine!
                [color=blue]
                > now i'm wondering, is it also a bad idea to run apache on my server and
                > have its document root set to this external drive too?[/color]

                The risk of data corruption is less, since typically files used by Apache
                are read-only. But I would still not do this. For instance, you said you
                plan to make your server open to external clients. What happens when
                someone tries to preview some of your staged websites, when your workstation
                is off?

                Regards,
                Bill K.


                Comment

                • Kevin D.

                  #9
                  Re: Error 1067 when starting as service, no problem in standalone


                  "Bill Karwin" <bill@karwin.co m> wrote in message
                  news:ds8ihc01s5 p@enews4.newsgu y.com...[color=blue]
                  > "Kevin D." <creepiedecrapp er@gmail.com> wrote in message
                  > news:%vPFf.5574 9$V.12616@fed1r ead04...[color=green]
                  >> my environment is for testing/development only, i'm a web developer
                  >> working from home and i just purchased an old compaq to use as my server[/color]
                  > . . .[color=green]
                  >> in short, i don't trust the compaq HD for keeping my data since it's
                  >> quite old, etc.[/color]
                  >
                  > If you have doubts about the stability of the hard drive in the Compaq,
                  > it's a pretty inexpensive task to replace the drive. Or replace the whole
                  > machine!
                  >[color=green]
                  >> now i'm wondering, is it also a bad idea to run apache on my server and
                  >> have its document root set to this external drive too?[/color]
                  >
                  > The risk of data corruption is less, since typically files used by Apache
                  > are read-only. But I would still not do this. For instance, you said you
                  > plan to make your server open to external clients. What happens when
                  > someone tries to preview some of your staged websites, when your
                  > workstation is off?
                  >
                  > Regards,
                  > Bill K.
                  >[/color]

                  points noted, but my workstation stays on all the time... i'm just trying to
                  off-load some cpu power from it and dedicate the "server" tasks to, well,
                  the server :)

                  i may have to consider moving all my web and db files to the server, and
                  just performing nightly backups onto the external drive


                  Comment

                  Working...