haymann Posted November 18, 2005 Report Share Posted November 18, 2005 This is probably an easy solution, but I have never learned anything about .bat files... Is it possible to add the mysqlrun.bat info in the start.bat file so that MySQL starts as well when I run start.bat? Right now I have both shortcuts in my start folder, but sometimes I think that mysqlrun.bat starts before start.bat is done.I thought that having them both start fom the same .bat might be a little more elegant... Ryan Quote Link to comment Share on other sites More sharing options...
olajideolaolorun Posted November 19, 2005 Report Share Posted November 19, 2005 Take a look here: http://sourceforge.net/tracker/index.php?f...691&atid=471255 Quote Best Regards Olajide Olaolorun The Uniform Server Development Team Link to comment Share on other sites More sharing options...
haymann Posted November 20, 2005 Author Report Share Posted November 20, 2005 Thanks for digging this up. I'll give it a shot.Thanks!Ryan Quote Link to comment Share on other sites More sharing options...
olajideolaolorun Posted November 20, 2005 Report Share Posted November 20, 2005 No problem Quote Best Regards Olajide Olaolorun The Uniform Server Development Team Link to comment Share on other sites More sharing options...
curly nostrill Posted November 27, 2005 Report Share Posted November 27, 2005 No problem 1916[/snapback] First I want to thank you for the most excellent work! THANKS! Next,... I looked at the link for the autostart mysql you provided at sourceforge but the solution provided there (afaict) seems to be another batch file. My question comes out of the actual uniserver 3.2a start.bat where there are three lines rem-ed out at the top pertaining to mysql. @echo off rem use: start mysql console - to start mysql at server start and display consolerem use: start mysql - to start mysql at server startrem use: start nomysql console - to display console This looks to me like i can insert or un-rem one of those lines in the start.bat to achieve the desired result...? But, like haymann, I too am unskilled and a little confused by the batch file language. Could you please direct me to the correct alteration of the batch file so that I have one file run at start up making certain mysql kicks in after uniserver is started or at an appropriate point to avoid conflicts or failures? I would also like to start unitray in the same batch file if that's possible... On my end I'll try to brush up on batch file writing in the hope that I will chase away a little bit more ignorance in my life... Thanks, curly ps. i hope this is not too much but i figgered i'd post the whole batch file here.... @echo off rem use: start mysql console - to start mysql at server start and display consolerem use: start mysql - to start mysql at server startrem use: start nomysql console - to display console diskw\home\admin\program\pskill.exe Apache.exeIF NOT ERRORLEVEL 1 goto startedset Disk=%1IF "%Disk%"=="" set Disk=wrem create the disksubst %Disk%: "diskw"IF ERRORLEVEL 1 goto hintset 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\phpIF "%2"=="mysql" start \usr\local\mysql\bin\mysqld-opt.exe --defaults-file=/usr/local/mysql/bin/my-small.cnfCLSecho The server is working on the disk %Disk%:\ [http/127.0.0.1/a/]start %Disk%:\home\admin\WWW\redirect.htmlIF "%3"=="console" goto consolestart %programit%uniserv.exe "%apacheit%" "%closeit%"goto end:console%apacheit%%closeit%goto end:hintCLSecho The disk %Disk% is busy. Use start.bat [disk letter]goto pause:startedCLSecho ERROR!!! echo One of the instances of Apache server is started. Use stop.bat:pauseecho .pause:end Quote Link to comment Share on other sites More sharing options...
olajideolaolorun Posted November 28, 2005 Report Share Posted November 28, 2005 Yes unremming them should work. Quote Best Regards Olajide Olaolorun The Uniform Server Development Team Link to comment Share on other sites More sharing options...
curly nostrill Posted November 28, 2005 Report Share Posted November 28, 2005 repeated post wiped Quote Link to comment Share on other sites More sharing options...
curly nostrill Posted November 28, 2005 Report Share Posted November 28, 2005 Thanks for the quick reply! But, no, didn't work. It looks like the section beginning %Disk%:cd \usr\local\phpIF "%2"=="mysql" start \usr\local\mysql\bin\mysqld-opt.exe --defaults-file=/usr/local/mysql/bin/my-small.cnfCLS might need some dressing up or maybe I need to "set mysql=%2" in the batch? no, that didn't work either... I like the ultra portability of uniserver so this is why i'd like to have one batch file and hopefully avoid installing the services. I'll keep messing with the batch file and command referrence at microsoftand post the working results if any. Quote Link to comment Share on other sites More sharing options...
olajideolaolorun Posted November 28, 2005 Report Share Posted November 28, 2005 There is a way to do it, but it has slipped my mind, kinda sick. 3.3 comes with a VBSript that allows you to start MySQL with the server. I will try and remember or go back to the code, but for now, i need rest lol. Quote Best Regards Olajide Olaolorun The Uniform Server Development Team Link to comment Share on other sites More sharing options...
bk2003 Posted November 28, 2005 Report Share Posted November 28, 2005 Hi, Try to just remove the If statement in the beginning of the row. I have done a this to my start.bat file. %Disk%: cd \usr\local\php start \usr\local\mysql\bin\mysqld-opt.exe --defaults-file=/usr/local/mysql/bin/my-small.cnf CLS /BK Quote Link to comment Share on other sites More sharing options...
olajideolaolorun Posted November 29, 2005 Report Share Posted November 29, 2005 I don't know if that works, not looking at codes now, but thanks BK. Quote Best Regards Olajide Olaolorun The Uniform Server Development Team Link to comment Share on other sites More sharing options...
curly nostrill Posted November 29, 2005 Report Share Posted November 29, 2005 Egggsellllent, /bk. works like a charm. Thanks! We'll get that wiki filled in soon if we keep it up. And now I will send my imaginary, super hot and sweet nurse to Olaj and she will feed him soup and give him a sponge bath... Many thanks all. curly Quote Link to comment Share on other sites More sharing options...
olajideolaolorun Posted November 29, 2005 Report Share Posted November 29, 2005 Quote Best Regards Olajide Olaolorun The Uniform Server Development Team Link to comment Share on other sites More sharing options...
MrX Posted November 29, 2005 Report Share Posted November 29, 2005 (edited) Just run a Command Prompt in the Uniform Server Directory and type:start.bat mysql(Don't use start as it may call Windows's start.exe instead of Uniform Server's start.bat) You could also make a shortcut with \start.bat mysql as the target and make it start in the Uniform Server Directory.Btw, don't forget to change to the Directory where you have Uniform Server installed No need for all the "messy" (imho) editing Edited November 29, 2005 by MrX Quote Link to comment Share on other sites More sharing options...
olajideolaolorun Posted November 29, 2005 Report Share Posted November 29, 2005 Thats what i forgot.. i knew i forgot a way to do it. Thanks & Welcome Back, >>Retsrating PC.. Quote Best Regards Olajide Olaolorun The Uniform Server Development Team Link to comment Share on other sites More sharing options...
curly nostrill Posted November 29, 2005 Report Share Posted November 29, 2005 No need for all the "messy" (imho) editing 1967[/snapback] How did you know my batch file is getting all messy?... heh Anyway, my goal is automation without having to open a whole command prompt, etc. yadda... It seems to me it would actually be easier to just start mysql from the spawned admin page which works fine. So far BK's suggestion worked gloriously (afict) and I've also used the same syntax adding Q&E FTP to the same batch file. I put a shortcut to my edited start.bat in the startup folder but I haven't actually tried it with a restart yet. SooOOOo, with my growing knowledge of batch files and your suggestion I may just make an entirely new batch file for my start up folder which calls the appropriate bat files after a delay which will allow XP to get settled first. I realize I may be reinventing the wheel here but what the hey... Looking forward to the new release with the vb script.... (btw I would be happy to give it a pre-release whirl) Thanks, curly Quote Link to comment Share on other sites More sharing options...
olajideolaolorun Posted November 29, 2005 Report Share Posted November 29, 2005 lamo Quote Best Regards Olajide Olaolorun The Uniform Server Development Team Link to comment Share on other sites More sharing options...
kyler Posted February 27, 2006 Report Share Posted February 27, 2006 Actually the correct code (for a default install) is ... start.bat w mysql Note the first parameter is the virtual drive letter (default is w)I run it as a modified shortcut on the desktop The comments on lines 9-11 of start.bat are incorrect according to the batch commands below it! Also a bit of confusion over what these line mean.Could I suggest: rem Server start options for this batch file: rem start w mysql console - to start mysql at server start and display console rem start w mysql - to start mysql at server start rem start w nomysql console - to display console %1 = Drive letter created by the server%2 = MYSQL if you want to run MYSQL automatically%3 = CONSOLE if you want to leave console open Just my 19cents ... CheersKyle Quote Link to comment Share on other sites More sharing options...
olajideolaolorun Posted March 2, 2006 Report Share Posted March 2, 2006 hmm... guess there are a lot of ways to do this.. :) Quote Best Regards Olajide Olaolorun The Uniform Server Development Team Link to comment Share on other sites More sharing options...
pixelsoul Posted March 9, 2006 Report Share Posted March 9, 2006 removing IF "%2"=="mysql" worked fine for me Quote Link to comment Share on other sites More sharing options...
skatingjim Posted March 15, 2006 Report Share Posted March 15, 2006 I may be kicking a dead horse by posting yet another opinion, but I want to say that you can avoid the need to open a command prompt and also avoid having to edit the batch file by simply setting the target of a Windows shortcut to: "C:\Uniform Server\Server_Start.bat" w mysql Of course you must modify this to conform to the actual location of the Uniform Server on your own machine. Sometimes I like to have the Uniform Server go directly to the website I am developing rather than having it display the apanel. This is especially nice when showing off your work to a customer or to colleages. I accomplish this by changing the file: "C:\Uniform Server\diskw\home\admin\www\redirect.html" There is a javascript script element in this file containing a window.setInterval() call that you can change to reference your home page. For example: window.setInterval("window.location = 'http://localhost/mycoolsite/'", 500); Of course you should safely preserve the original so you can revert to displaying the apanel since that is the best approach for general development use. Finally. an experiment that I have not tried yet is to make the redirect.html modification above and then put the whole thing onto a CD-ROM with an autorun that will launch the server with the correct SQL enabled command line. Quote Link to comment Share on other sites More sharing options...
AlleyKat Posted March 17, 2006 Report Share Posted March 17, 2006 Sorry, but no can do, it's not quite that easy... first thing that'll happen: Apache trying to write to its own (now readonly) log files that it has started... second thing is the same for the MySQL server. The solution would be something like:Reconf Apache to store temp and log files on c:Reconf MySQL to store all data on c:Each time the CD is autorun, it should run a check to see if it has been run before (like, if c:\UniServFiles\ doesn't exist, create it and copy the MySQL datafiles over there for use).Optimum, the system should check if port 80 is in use already? OK, not needed, but practical... Quote Link to comment Share on other sites More sharing options...
skatingjim Posted March 21, 2006 Report Share Posted March 21, 2006 Oops, you're right. I feel kind of stupid now. I should have quit while I was ahead. Quote Link to comment Share on other sites More sharing options...
olajideolaolorun Posted March 24, 2006 Report Share Posted March 24, 2006 lmmfao... Quote Best Regards Olajide Olaolorun The Uniform Server Development Team Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.