Help - Search - Members - Calendar
Full Version: Problem with autostarting MySQL
The Uniform Server BBoard > Support > Uniform Server - Windows > MySQL
wex-alpha
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 sad.gif

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
[CODE]
: 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% smile.gif

@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 // erased IF "%2"=="mysql"
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 sad.gif damn mysql smile.gif




Thanks smile.gif
wex-alpha
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.

CODE

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 smile.gif
wex-alpha
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

CODE

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:

QUOTE
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 smile.gif

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
CODE

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
megan
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:

<meta http-equiv="refresh" content="20;url=http://localhost/"> (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
olajideolaolorun
Thanks megan biggrin.gif

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 smile.gif
wex-alpha
Thanks for detailed response. I cant wait to try that tomorrow.

I will let you know smile.gif
wex-alpha
This worked like a charm.


Thanks again smile.gif
olajideolaolorun
smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.