28 November 2008

Access denied Linux MySQL error solution

I have not worked much with Linux and today i installed MySQL on Ubuntu 8.10. I logged in using the command "mysql -u root -p password". I was happily logged into MySQL and was able to execute commands like "show databases".
Then tried to create a database called kilo using the command
create database kilo;
and was greeted with the error below.
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'kilo'

The problem was in the space between -u and root. So the correct command to use is mysql -uroot -ppassword

26 November 2008

Skipping Test execution phase in Maven

In few scenarios we may want to skip the execution of tests in Maven. [For example when the execution of tests need special setup which may not be available to the build machine.]

we can use the following command which mentions the argument maven.test.skip to skip test execution phase.
mvn -Dmaven.test.skip=true clean install

24 November 2008

How to refer environment variables in ANT

We may have to access environment variables in our ANT build script. To do this, let us provide a handler to access the environment as below
<property environment="env"/>
Then you can refer any of the environment value like computer name on which the build script is run as below
<property name="destinationmachinename" value="dest.${env.COMPUTERNAME}"/>