Fastcloud’s Blog


How to install apache ant on Fedora 8

If you just want to run ant, install it using yum:

yum install ant

But if you need to execute the optional ant tasks like scp, junit, etc. you need to “install” ant manually. Please make sure that a java runtime is installed and the variable JAVA_HOME points to the root directory of the java installation.

Save this script as “install-ant.sh” and execute it as root:
yum install wget
cd /tmp
wget http://ftp.uni-erlangen.de/pub/mirrors/apache/ant/binaries/apache-ant-1.7.1-bin.tar.gz
tar xfz apache-ant-1.7.1-bin.tar.gz
mkdir /usr/share/ant
cp -r -f apache-ant-1.7.1/* /usr/share/ant/
export ANT_HOME=/usr/share/ant/
export PATH=$PATH:$ANT_HOME/bin
echo"
export ANT_HOME=/usr/share/ant
export PATH=$PATH:$ANT_HOME/bin:$JDK_HOME/bin
" >> /etc/profile
echo "apache ant has been installed."
exit;

If the script fails to download the tarball visit http://ant.apache.org/bindownload.cgi , coose another mirror and replace the url in the script above.

Comments Off on How to install apache ant on Fedora 8

mysql -h localhost -u root -p myrootpassword produces “access denied” (or similar) errors

If the following command doesn’t work for you
mysql -h localhost -u root -p myrootpassword
and produces errors like:
ERROR 1045 (28000): Access denied for user 'root'@'localhost'
or
ERROR 1049 (42000): Unknown database 'myrootpassword '
try the following command:
mysql -h localhost -u root -p Note: NO password is passed to the -p parameter!
You’ll be prompted for your password -> Enter it.

You could also try:
mysql -h localhost -u root --password="myrootpassword"

How to execute sql-script with the mysql console?
If you want to execute a *.sql-file you might try the following command:
mysql -h localhost -u root --password="myrootpassword" --database="mydb" < /path/to/my/sqlfile.sql -- Note: single line!

Comments Off on mysql -h localhost -u root -p myrootpassword produces “access denied” (or similar) errors