Monday, September 28, 2009

This Week [40] Motivation

Life isn't about finding yourself...
Life is about CREATING yourself...

Thursday, September 24, 2009

This Week [39] Motivation

Work doesn't hurt anybody!

Tuesday, September 15, 2009

Friday, September 11, 2009

MySQL - Searching for database

If you want to find mysql db files then run this:

# find / -name "*.MYI" -exec ls -al {} \;

this will find any file that has extension MYI (one of mysql table files)

Thursday, September 10, 2009

MySQL - Create/password user

1. Creating a new user. Login as root. Switch to the MySQL db. Make the user. Update privs.

# mysql -u root -p
mysql> use mysql;
mysql> INSERT INTO user (Host,User,Password) VALUES('%','username',PASSWORD('password'));
mysql> flush privileges;

2. Change a users password from unix shell.

# [mysql dir]/bin/mysqladmin -u username -h hostname.com.my -p password 'new-password'

MySQL - Backup database

The mysqldump utility can be found in the /usr/local/bin directory on Unix/Linux systems where MySQL is installed.

mysqldump -p [db name] > [db name.dmp]

MySQL - Basic command for support

This is a list of MySQL commands that I use time and time again.

1. to login
mysql -u root -p
  
2. to list all databases
mysql> show databases;
   
3. switch to a databases
mysql> use [db name];
      
4. to see all table in database
mysql> show tables;
    
5. to see database's field formats
mysql> describe [table name];