Friday, October 19, 2012

How to find Compiler version of Unix boxes



 SOLARIS:
# which cc
/opt/SUNWspro/bin/cc
# cd /opt/SUNWspro/bin/
# CC -V

AIX:
# which cc
/usr/vac/bin/cc
# cd /usr/vac/bin/
# ./xlc_r –version

Linux:
# which cc
/usr/bin/cc
# cd /usr/bin/
# gcc –v

HPUX:
# which cc
#aCC -V

How to configure MySQL 5.1 on RedHat Linux


Download required MySQL rpm packages
MySQL-client-community-5.1.25-0.rhel5.i386.rpm
MySQL-server-community-5.1.25-0.rhel5.i386.rpm
MySQL-devel-community-5.1.25-0.rhel5.i386.rpm


Install the downloaded MySQL rpm packages
rpm -ivh MySQL-server-community-5.1.25-0.rhel5.i386.rpm MySQL-client-community-5.1.25-0.rhel5.i386.rpm

Set the root password
/usr/bin/mysqladmin -u root password 'root123'

How to stop and start MySQL
service mysql status
service mysql stop
service mysql start


# /sbin/service mysqld restart


Log into MySQL
mysql -u root -p


How to check the MySQL version
SHOW VARIABLES LIKE "%version%";

How to create a database and granting permission
CREATE DATABASE test;

GRANT ALL ON test.* TO user1@'%' IDENTIFIED BY "user123";


How to drop a database and user
DROP DATABASE test;

SELECT host, user, password FROM mysql.user;

DROP USER 'user1'@'localhost';
or
DROP USER 'user1'@'%';