Thursday, December 13, 2012

How to find a character set of database / table / column in MySQL?

This post describes how to check the character set of a database/ table/ column in MySQL.
Database:

SELECT default_character_set_name FROM information_schema.SCHEMATA S WHERE schema_name = "schemaname";

Table:

SELECT CCSA.character_set_name FROM information_schema.`TABLES` T, information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA WHERE CCSA.collation_name = T.table_collation AND T.table_schema = "schemaname" AND T.table_name = "tablename";

Column:

SELECT character_set_name FROM information_schema.`COLUMNS` C WHERE table_schema = "schemaname" AND table_name = "tablename" AND column_name = "columnname";

How to create and delete profiles in IBM WebSphere

How to create a new profile in IBM WebSphere
Go to /home/abc/IBM/WebSphere/AppServer/bin/ProfileCreator ./pct.bin

How to delete WAS profiles - This will delete all profiles in the AppServer
Go to /home/abc/IBM/WebSphere/AppServer/bin and ./wasprofile.sh –deleteAll

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'@'%';