Friday, November 18, 2011

Installing MySQL on Ubuntu without apt-get

If you are trying to install MySQL on a box that does not have internet connection, installation will be challenging.

This post explains how MySQL can be installed and configured by downloading individual .deb files.

1. Identify your Ubuntu distribution name/version and architecture 

For checking your Ubuntu distribution name,
root@localhost:$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.3 LTS"

For checking the architecture,use "uname -m" or arch command
root@localhost:/etc/mysql$ uname -m
x86_64

2. Download below packages from packages.ubuntu.com (links below correspond to amd64 architecture and lucid distribution, you will have to change this according to your configuration)

http://packages.ubuntu.com/lucid/all/libnet-daemon-perl/download
http://packages.ubuntu.com/lucid/all/libplrpc-perl/download
http://packages.ubuntu.com/lucid/amd64/libdbi-perl/download
http://packages.ubuntu.com/lucid/amd64/mysql-common/download
http://packages.ubuntu.com/lucid/amd64/libmysqlclient16/download
http://packages.ubuntu.com/lucid/amd64/libdbd-mysql-perl/download
http://packages.ubuntu.com/lucid-updates/amd64/mysql-client-core-5.1/download
http://packages.ubuntu.com/lucid-updates/amd64/mysql-client-5.1/download
http://packages.ubuntu.com/lucid-updates/amd64/mysql-server-core-5.1/download
http://packages.ubuntu.com/lucid-updates/amd64/mysql-server-5.1/download
http://packages.ubuntu.com/lucid/all/libhtml-template-perl/download
http://packages.ubuntu.com/lucid-updates/all/mysql-server/download


3. Install downloaded packages in the same order

sudo dpkg -i libnet-daemon-perl_0.43-1_all.deb
sudo dpkg -i libplrpc-perl_0.2020-2_all.deb
sudo dpkg -i libdbi-perl_1.609-1build1_amd64.deb
sudo dpkg -i mysql-common_5.1.41-3ubuntu12.10_all.deb
sudo dpkg -i libmysqlclient16_5.1.41-3ubuntu12.10_amd64.deb
sudo dpkg -i libdbd-mysql-perl_4.012-1ubuntu1_amd64.deb
sudo dpkg -i mysql-client-core-5.1_5.1.41-3ubuntu12.10_amd64.deb
sudo dpkg -i mysql-client-5.1_5.1.41-3ubuntu12.10_amd64.deb
sudo dpkg -i mysql-server-core-5.1_5.1.41-3ubuntu12.10_amd64.deb
sudo dpkg -i mysql-server_5.1.41-3ubuntu12.10_all.deb
sudo dpkg -i libhtml-template-perl_2.9-1_all.deb
sudo dpkg -i mysql-server-5.1_5.1.41-3ubuntu12.10_amd64.deb

During mysql-server-5.1 installation, you will be asked to provide the root user name and password. Make sure you remember what you provide here, without the root id and password you will not be able to connect to MySQL server.

To check whether MySQL is installed correctly, run the command
sudo netstat -tap | grep mysql

Reference 1:- http://askubuntu.com/questions/29533/install-mysql-without-apt-get

Thursday, November 17, 2011

Syntax highlighting on blogger

I always wanted a 'wiki' like functionality on blogger so that my technical posts are more readable (Highlighting commands, posting source code with line numbers etc..)

Some good options are :-

1. Using JEdit and Code2Html plugin - http://thinktibits.blogspot.com/2011/04/best-syntax-highlighter-for-bloggerpart.html

2. Alex Gorbatchev's Syntax Highlighter - http://alexgorbatchev.com/SyntaxHighlighter. Here is an example of how it is used on blogger - http://abhisanoujam.blogspot.com/2008/12/blogger-syntax-highlighting.html

3. Using google code prettify - http://code.google.com/p/google-code-prettify/. See the README file for implementation details. Here is a sample blog that uses google code preffify - http://blog.js-development.com/2008/01/finally-syntax-highlighting-on-my-blog.html

If you just need a simple highlighting mechanism, try editing the design template as explained below.

1. Open the template html (Template -> Edit HTML)



2. Look out for </b:skin> and add below piece of code as shown :-

code {background:whitesmoke; font-family: Arial; display:block; border:1px solid #999999; padding:10px;}

]]></b:skin>


3. Enclose the text that you want to highlight in <code></code> block

<code>
Your text here...
</code>


Sunday, November 13, 2011

Rpm installation - where can I find the installed files?


I recently installed ganglia to monitor the performance of my hadoop cluster running on fedora 14. Ganglia installation mainly consists of gmetad, gmond and the php web front end (ganglia-web). I installed these packages using the software update manager that comes with Fedora 14. After the installation was completed, I was trying to copy the gangila web files to my apache web root (/var/www/html) and I just could not locate the php web front end files!!

After a bit of googling I found out the command that I was searching for - rpm -ql <package name>

rpm -ql ganglia-web

SQL1092N "USER" does not have the authority to perform the requested command

The error "SQL1092N <USER> does not have the authority to perform the requested command" usually comes when a domain user tries to perform a database operation that requires administrative privileges.

To resolve this, perform below steps (Windows OS):-

1. Execute "db2set DB2_GRP_LOOKUP=LOCAL" from db2 command editor
2. Create a new group called DB2ADMNS (Right click My Computer -> Manage -> Computer Management ->  System Tools -> Local Users and Groups -> Groups
3. Add the domain user to the DB2ADMNS group
4. Execute "db2 update dbm cfg using sysadm_group DB2ADMNS" from db2 command editor
5. Execute "db2stop"
6. Execute "db2start"

Tuesday, November 01, 2011

WebSphere Commerce 7 feature packs - troubleshooting

I was getting below error while trying to install feature pack 1 for Websphere Commerce 7 developer edition (I selected "Enable all features" option in IBM installation manager at the final step of feature pack installation) There are two ways to resolve this :-
  1.  Try enabling the features one by one. Refer http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.install.doc/tasks/tigfepenable.htm

  2.  Try increasing the maximum heap size in enablefeature.bat 
  3.  
%RAD_HOME%\jdk\bin\java -cp "%CP%" -Xmx1536m -DLOGFILE=%LOG% org.eclipse.equinox.launcher.Main -application com.ibm.etools.j2ee.ant.RunAnt -logger com.ibm.commerce.config.internal.ant.loggers.FileLogger -data %WORKSPACE_DIR% -DWCInstallDir=%WCTOOLKIT% -DRADHome=%RAD_HOME% -Dworkspace=%WORKSPACE_DIR% -Dwashome=%WAS_HOME% -Dejbdir=%EJB_DIR% -buildfile %WCTOOLKIT%\components\common\xml\enableFeatureForToolkit.xml %*