Old:Bugs 3.5-Apollo: Close bat: Difference between revisions

From The Uniform Server Wiki
Jump to navigation Jump to search
m (Protected "Bugs 3.5-Apollo: Close bat" [edit=sysop:move=sysop])
m (BobS moved page Bugs 3.5-Apollo: Close bat to Old:Bugs 3.5-Apollo: Close bat without leaving a redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<span id="top"></span>
{{Uc nav 3.5 bugs}}
<div style="padding:0;margin:0; border-bottom:3px inset #000000">
{|
| [[Image:uc_small_logo.gif | MPG UniCenter]] ||
Bugs 3.5-Apollo:
[[Bugs 3.5-Apollo: Introduction | Introduction]] | 
[[Bugs 3.5-Apollo: Server_Start_bat | Server_Start.bat]] | 
[[Bugs 3.5-Apollo: Start_vbs | Disk Start.vbs]] | 
[[Bugs 3.5-Apollo: Close_bat | Close.bat]] |
[[Bugs 3.5-Apollo: config_inc_php | config.inc.php]] |
[[Bugs 3.5-Apollo: apanel blown away | apanel - blown away]] |
[[Bugs 3.5-Apollo: Combined bug fix | Combined bug fix]]
|}
</div>
{| cellpadding="2"
|
__TOC__
||
'''Uniform Server 3.5-Apollo known bugs or issues'''
|}
'''''Close.bat'''''
'''''Close.bat'''''
 
== Bug fix: Pick-up MySQL root password ==
== Bug fix to pick-up MySQL root password ==
File: '''Close.bat'''<br>
File: '''Close.bat'''<br>
Location: '''*\Uniform Server\udrive\home\admin\program'''
Location: '''*\Uniform Server\udrive\home\admin\program'''


'''Problem:''' This script shuts down the MySQL server and removes virtual drive created. When MySQL root password is changed this script fails to pick it up and server remains running.
'''Problem:''' This script shuts down the MySQL server and removes the virtual drive created. When MySQL root password is changed this script fails to pick it up and server remains running.


'''Solution:''' Copy MySQL password from file mysql_password into a variable and use that to shut down the server.
'''Solution:''' Copy MySQL password from file mysql_password into a variable and use that to shut down the server.
Note '''''pushd''''' is required to define a new reference (where this script is located) point for Windows otherwise it will use the location of the calling script. After the script has run original location of the calling script is restored by '''''popd'''''.
Note: '''''pushd''''' is required to define a new reference point for Windows (where this script is located), otherwise it will use the location of the calling script. After the script has run, the original location of the calling script is restored by '''''popd'''''.


{| cellpadding="2" cellspacing="1" style="background:#000000;"
{| cellpadding="2" cellspacing="1" style="background:#000000;"
Line 86: Line 66:
See above.
See above.


'''''[[#top | Top]]'''''


----
----
Line 94: Line 73:
|}
|}


[[Category: UniCenter]]
 
[[Category: Support]]
[[Category: Archive]]
[[Category: Patches]]
[[Category: Troubleshooting]]

Latest revision as of 12:27, 21 June 2013

Uniform Server 3.5-Apollo known bugs or issues.

Close.bat

Bug fix: Pick-up MySQL root password

File: Close.bat
Location: *\Uniform Server\udrive\home\admin\program

Problem: This script shuts down the MySQL server and removes the virtual drive created. When MySQL root password is changed this script fails to pick it up and server remains running.

Solution: Copy MySQL password from file mysql_password into a variable and use that to shut down the server. Note: pushd is required to define a new reference point for Windows (where this script is located), otherwise it will use the location of the calling script. After the script has run, the original location of the calling script is restored by popd.

Changes as shown:
: Name: Close.bat
: Location: *\Uniform Server\udrive\home\admin\program
: Created By: The Uniform Server Development Team
: Original By: Olajide Olaolorun (empirex)
: Edited Last By: MPG 14-4-08
: Comment: Added push and popd to define current working directory.
: This allows the MySQL password to be picked up.
: This password is required to correctly shutdown MySQL server.

@echo off
:Define current working directory
pushd %~dp0

set Disk=%1
IF "%Disk%"=="" set Disk=w
%Disk%:\home\admin\program\pskill.exe mysqld-opt.exe
IF ERRORLEVEL 1 goto nomysql

:MySQL server is running get password
SET /P pass=<..\www\mysql_password

:Access server using password and shutdown server

:### Next two lines should be on a single line #####

%Disk%:\usr\local\mysql\bin\mysqladmin.exe --character-sets-dir="/usr/local/mysql/share/charsets/"
 --user=root --password=%pass% shutdown

:nomysql

:Kill off virtual drive
subst %Disk%: /D

:Restore original location
popd


Download

Download this file Close.bat.txt save it as Close.bat copy to folder *\Uniform Server\udrive\home\admin\program

Note: Allow it to overwrite existing file.

Forum reference

Additional information or background can be found on these forum pages.

The above is a possible cause for the annoying beep in this forum post

Proposed solution

See above.



Ric