Jump to content
The Uniform Server Community

Problem with autostarting MySQL


wex-alpha
 Share

Recommended Posts

I posted previously about thid problem. I am trying to make a Joomla release on the stick, but I am always hitting the same problem :(

 

Nice Admin told me to look for previous posts concerning this issues, and I did... but without success.

 

This is what I have done:

This is my modified bat file

: Name: Start Server File

: Created By: The Uniform Server Development Team

: Edited Last By: Olajide Olaolorun (empirex)

: Comment: After start, go to apanel directly.

: To Developers: Implemented %www%, and %apanel% :)

 

@echo off

 

rem use: start mysql console - to start mysql at server start and display console

rem use: start mysql - to start mysql at server start

rem use: start nomysql console - to display console

 

diskw\home\admin\program\pskill.exe Apache.exe

IF NOT ERRORLEVEL 1 goto started

set Disk=%1

IF "%Disk%"=="" set Disk=w

rem create the disk

subst %Disk%: "diskw"

IF ERRORLEVEL 1 goto hint

set apachepath=\usr\local\apache2\

set apacheit=%Disk%:%apachepath%bin\Apache.exe -f %apachepath%conf\httpd.conf -d

 

%apachepath%.

set programit=%Disk%:\home\admin\program\

set closeit=%programit%close.bat %Disk%

 

%Disk%:

cd \usr\local\php // [color=red]erased IF "%2"=="mysql"[/color]

start \usr\local\mysql\bin\mysqld-opt.exe

 

--defaults-file=/usr/local/mysql/bin/my-small.cnf

CLS

echo The server is working on the disk %Disk%:\ [http/127.0.0.1/apanel/]

set www=\www\

set apanel=\home\admin\www\

start %apanel%\redirect.html

IF "%3"=="console" goto console

start %programit%uniserv.exe "%apacheit%" "%closeit%"

goto end

:console

%apacheit%

%closeit%

goto end

:hint

CLS

echo The disk %Disk% is busy. Use 'Disk Start.vbs' [disk letter]

goto pause

:started

CLS

echo ERROR!!!

echo One of the instances of Apache server is started. Use Stop.bat

:pause

echo .

pause

:end

 

To mention I have changed redirect.html to go to http://localhost where resided Joomla.

 

When I start that modified bat, localhost will not start... its just repeating to load, I think at that point mysql is not loaded at all.

 

I went to http://localhost/apanel and manually clicked run mysql, after that localhost was able to start normally.

 

Can anyone help me with this?

This is irritating, I see the power of uniform server, and its right under my fingers, yet I cant useit :( damn mysql :)

 

 

 

 

Thanks :)

Link to comment
Share on other sites

I have worled hard on this problme, and I was able to find a workaround for it.

 

I used autoit program for automating tasks in windows.

 

Here is the code that makes it all work.

 

Run("diskw\usr\local\mysql\bin\mysqld-opt.exe")
Run("Server_Start.bat")

 

But one other problem remains... its the fact that apache remains loaded, even when when we close browser (which is normal).

That leads to another problem, if I startit again, I got error message to run stop.

 

There should be a way to do if statement in start.bat to check if apache is already loaded. If yes, proceed, if no load it.

 

Now I am lost, couse I am not skilled in batch thingies... if someone would help, it would be greatly appreciated.

 

Thank you :(

Link to comment
Share on other sites

I am sorry if this sounds like a monologue, but I am not used to sit and wait. I search for answers...

 

Anyway, I have overlooked the following line from start.batt

 

diskw\home\admin\program\pskill.exe Apache.exe

 

Apparently it should terminate any existing apache process.

 

I think that line is wrong, it should be:

 

diskw\home\admin\program\pskill.exe Apache.exe  c

 

Maybe I mispelled it, couse I am home now, and my files are at work PC :(

 

That works, but with small problem, that i need to get rid of.

 

Assume I start my start.exe start program. It loads WAPM and runs my web page. Once I close it, apache proccess remains loaded.

 

If I click again on start.exe program the

diskw\home\admin\program\pskill.exe Apache.exe c

 

kills the apache threads as it should, but also terminates itself with error.

Next run is ok.

 

Now, is there a way to terminate any existing apache process, and yet continue with batch execution?

 

I hope i was not too complex.

 

Thank you

Link to comment
Share on other sites

Hello -

 

I know nothing of Joomla, however to start mysql on server startup without having to go to the admin, open Server_Start.bat (original unchanged file) and about line 28 remove the IF statement from 'IF "%2"=="mysql" start \usr\local\mysql\bin\mysqld-opt.exe --defaults-file=/usr/local/mysql/bin/my-small.cnf' so that it reads:

start \usr\local\mysql\bin\mysqld-opt.exe --defaults-file=/usr/local/mysql/bin/my-small.cnf

 

as for the problem with the looping redirect you can fix that, just open diskw\home\admin\www\refresh.html in a text editor. get rid of the javascript redirect and add the following code to the document head:

 

(you may have to play with the time delay interval ).

 

You might also want to add a little "Starting Servers..., Please Wait..." message to the content area.

 

hth ~megan

Link to comment
Share on other sites

Thanks megan :(

 

All the troubles he had to put himself to get it working... Most of what you did seem to cause more problems than help you. Here is the post i was talking about: http://forum.uniformserver.com/index.php?showtopic=275 :(

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...