MySQL silent install fails - mysql

I am trying to install mysql-installer-community-5.6.20.0.msi through batch file.
In the first step I try to unpack the manifest which gives me access to installer console. Passive install works alright however, if I try to install it quietly the batch file exits without unpacking the manifest.
Here is the 1st step batch file code:
#echo off
color 0a
cls
echo ==========================================
echo MySQL Server - Installation - v.11/02/2015
echo ==========================================
echo .
echo .
rem ------------------------------------------------
echo Installing MySQL (This may take a few minutes)
msiexec /i mysql-installer-community-5.6.20.0.msi /q /norestart /L*v "mysql-installer-community-5.6.20.0.msi.log"
echo Done.
Do anyone have a way around this error?

/q may be raising an error since it's the the first character of user interface level options (/qn for example). Try using the full quiet option, /quiet

Finally found the solution, found out that the log file was showing 1729 and the next line showed configuration failed message.
Searching for error code 1729 in MySQL error codes. I found
Error: 1729 SQLSTATE: HY000 (ER_NO_SUCH_PARTITION)
Message: partition '%s' doesn't exist
Figured it may be as cmd was launching from System32. Adding %~dp0 (current directory) solved the issue.
I hope this may help others.

Related

How to intentionally leave a package half configured?

I'm trying to test Wazuh configuration related to half-configured packages. So, I'm trying to create a .deb package that will end up half configured when installed.
I started by following these instructions for creating a dirt-simple, do-nothing package.
I tried changing the exit code of debian/postinst.ex to 1, but the package installed successfully anyway.
I tried adding a non-existing file to debian/conffiles, but debuild failed.
I've also searched all over for information on the things that can cause a package to be left half configured, without any luck.
Thanks!
First of all, I want to mention that there are two different status for failed installed packages:
half-configured: The package is unpacked and configuration has been started, but not yet completed for some reason.
half-installed: The installation of the package has been started, but not completed for some reason.
Source: https://www.man7.org/linux/man-pages/man1/dpkg.1.html
If you want a half-configured package, then the package must be unpackaged and it is the configuration step the one that should fail.
Now, if you follow the guide you shared with us, you may have missed the part where it says that the *.ex files are examples and are not introduced in the package so if you're modifying the file postinst.ex, these changes will no take effect.
You can remove all the *.ex files and create your own postinst file. For example I've used this one:
root#ubuntu:/tmp/build/greetings-0.1# cat debian/postinst
#!/bin/sh
# postinst script for greetings
#
# see: dh_installdeb(1)
set -e
case "$1" in
configure)
echo "configuring..."
sleep 1
echo "..."
sleep 2
echo "ERROR!"
exit 1
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
Using this file (with the correct name), your code will be executed after the package installation. And you will get something like this:
root#ubuntu:/tmp/build# apt-get install ./greetings_0.1-1_all.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'greetings' instead of './greetings_0.1-1_all.deb'
The following NEW packages will be installed:
greetings
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 0 B/2916 B of archives.
After this operation, 14.3 kB of additional disk space will be used.
Get:1 /tmp/build/greetings_0.1-1_all.deb greetings all 0.1-1 [2916 B]
Selecting previously unselected package greetings.
(Reading database ... 76875 files and directories currently installed.)
Preparing to unpack .../build/greetings_0.1-1_all.deb ...
Unpacking greetings (0.1-1) ...
Setting up greetings (0.1-1) ...
configuring...
...
ERROR!
dpkg: error processing package greetings (--configure):
installed greetings package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
greetings
E: Sub-process /usr/bin/dpkg returned an error code (1)
Then, you could use the -s flag on dpkg to check the package status:
root#ubuntu:/tmp/build# dpkg -s greetings
Package: greetings
Status: install ok half-configured
Priority: optional
Section: unknown
Installed-Size: 14
Maintainer: Person McTester <person#company.tld>
Architecture: all
Version: 0.1-1
Description: <insert up to 60 chars description>
<insert long description, indented with spaces>
Homepage: <insert the upstream URL, if relevant>
As you can see, as the package has no way to handle this kind of error, the package is still installed and its status is install ok half-configured
I hope this has helped you :)

TYPO3 error configuring extension "sphinx"

I've installed latest sphinx version 2.3.1.
I have TYPO3 CMS 6.2.19.
Before sphinx can be used it must be configured. Now in sphinx configuration area I click on Sphinx 1.4.5. After some time I get following message:
Sphinx 1.4.5 has been downloaded.
Could not extract Sphinx 1.4.5:
Could not extract 3rd-party libraries for Sphinx:
Archive: /opt/lampp/htdocs/cms1/typo3temp/sphinx-contrib.zip
Inconsistency detected by ld.so: dl-open.c: 596: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!
Could not find a compatible version of Pygments
I could debug this extension and found out it crashes at following command:
CommandUtility::exec("'/usr/bin/unzip' '/opt/lampp/htdocs/cms1/typo3temp/sphinx-contrib.zip' -d '/opt/lampp/htdocs/cms1/uploads/tx_sphinx/sphinx-contrib' 2>&1", $out, $returnValue);
If I execute it from a php-one-line script I get following message:
lchmod (file attributes) error: Function not implemented
Does anybody understand what is wrong with it???
OK. I've found a workaround myself: it were libraries. So I had to preload another versions.
All in all, the way is: in the file where unzip is called (Setup.php) in the function unarchive add LD_PRELOAD=/lib64/libgcc_s.so.1:/usr/lib64/libstdc++.so.6 before unzip command. Now it looks as follows:
$cmd = 'LD_PRELOAD=/lib64/libgcc_s.so.1:/usr/lib64/libstdc++.so.6 ' . $unzip . ' ' . escapeshellarg($archiveFileName) ...
And yes, it is not the best solution, but it worked for me.

VS2012: xcopy error with cocos2dx

I have a solution on VS 2012 that has been building without errors, then out of no where the build started failing with the following error :
Error 106 error MSB3073: The command "if not exist "C:\Workspace\cocos2d-x-2.2.2\tools\project-creator\undefined\proj.win32\Debug.win32\" mkdir "C:\Workspace\cocos2d-x-2.2.2\tools\project-creator\undefined\proj.win32\Debug.win32\"
xcopy /Y /Q "C:\Workspace\cocos2d-x-2.2.2\tools\project-creator\undefined\proj.win32\..\..\..\external\libwebsockets\win32\lib\*.*" "C:\Workspace\cocos2d-x-2.2.2\tools\project-creator\undefined\proj.win32\Debug.win32\"
:VCEnd" exited with code 4. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets 129 5 undeifned
This solution is created by Cocos2d-x tool.
How to fix bug ?
The encrypted message mean the folder/files are in use.
I just have the same error a few minutes ago.
Close all the program and reopen.
Reboot if the above failed.

how to enable mysql on php5.... apache 2.2 on windows

So I've uncommented the the *extension=php_mysql.dll* line in the php.ini file and I've also filled in the *extension_dir* and *doc_root* but everytime I try to run a php file with the following code:
<?php
mysql_connect("localhost", "root", "admin") or die(mysql_error());
echo "Connected to MySQL<br />";
?>
I get the following error:
"Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Software Foundation\Apache2.2\vhosts\guestbook\extract.php on line 3"
Does anyone know how to fix this?
Your PHP is enabled - that's what's throwing the error you are seeing.
The problem is with the PHP config. The mysql extension is not loaded.
I've uncommented the the *extension=php_mysql.dll* line
And have you checked the file exists in the specified extension dir and is readable by the webserver?
Have you checked that this is the php.ini file your webserver is using? (try running a script with just a call to phpinfo() in it).
It sounds like you have either not restarted Apache for php.ini changes to take effect, or that you do not have the PHP /ext path in your system PATH variable (or it's set wrong in php.ini).
Consider using a pre-configured and fully set up WAMP package such as:
xampp (free) -
WampDeveloper Pro (commercial) -
WampServer (free)

Command line to change path to .mdb file for MS Access ODBC System DSN?

What odbcconf.exe command line can I use to change the path to the MS Access .mdb file for an already existing System DSN?
You would have to do it by changing the registry. Something along the lines of this example taken from the net that I have used before
rem -----Author: Jim Michaels
rem -----copy the drivers where all good little ODBC drivers go
if errorlevel 1 goto bye
copy myodbcd.dll C:\WINDOWS\SYSTEM
if errorlevel 1 goto bye
rem ----create a .REG file to make registry entries
echo REGEDIT4>myodbc.reg
echo.>>myodbc.reg
echo [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\MySQL]>>myodbc.reg
echo "APILevel"="2">>myodbc.reg
echo "ConnectFunctions"="YYN">>myodbc.reg
echo "Driver"="C:\\WINDOWS\\SYSTEM\\myodbc.dll">>myodbc.reg
echo "DriverODBCVer"="02.50">>myodbc.reg
echo "FileExtns"="*.txt">>myodbc.reg
echo "FileUsage"="0">>myodbc.reg
echo "Setup"="C:\\WINDOWS\\SYSTEM\\myodbc.dll">>myodbc.reg
echo "SQLLevel"="1">>myodbc.reg
echo.>>myodbc.reg
echo [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers]>>myodbc.reg
echo "MySQL"="Installed">>myodbc.reg
echo.>>myodbc.reg
rem -----install the registry entries by executing the .REG file
start /wait myodbc.reg
rem ----clean up after we are done installing
del myodbc.reg
:bye
If you look at your existing DSN config in the registry then you will get an idea of how to modify the code to suit your situation
To answer the question as asked, here is a solution using odbcconf.exe instead of going straight to the registry:
odbcconf.exe configsysdsn ^
"Microsoft Access Driver (*.mdb, *.accdb)" ^
"DSN=OurConnectionName;DBQ=X:\Path\to\OurMsAccessDB.mdb"
Two items of note which had me tripped up for a while:
make sure you use 64bit odbcconf.exe when on a 64bit system, see https://stackoverflow.com/questions/6721702/windows-7-64-bit-odbc-drivers-for-ms-access-missing.
use DBQ= and not Database= for the mdb path. When using the latter everything appears to work, however the connection link is named but not actually defined in the ODBC Administrator.