Tuesday, January 18, 2011

Learning MySQL on linux - Installation

MySQL on Linux

MySQL - Installation 

Installing mysql on Redhat is very simple wia repostory also packages are avaliable in redhat dvd itself. For more information click, dvd repository and rpm forge. For detailed installation about MySQL with all systems check this page.

Normaly MySQL having 2 parts,
  • MySQL Server
  • MySQL Client
MySQL server -  It's program to managing storage of data

MySQL Client - It's a program for user intraction and we can get stored data by queries. 

Installing MySQL with repository

Open terminal window and in root account, run following comment

#yum install mysql*

type y and hit enter, this will install MySQL on your redhat system.

For start MySQL,

in terminal type " service mysqld start " without cotes.

For check status of MySQL running on your linux box, in terminal type "service mysqld status " without cotes.

Login in to MySQL on linux box,

In terminal window, type

#mysql -u root mysql

and hit enter, you get a mysql prompt as follow,

In mysql -u root mysql,

mysql :
mysql -u root mysql

highlighted 'mysql' will start mysql client for user intraction.

-u :
mysql -u root mysql

highlighted '-u' says to MySQL chient which user want to login into MySQL server.

root :
mysql -u root mysql

highlighted 'root' mentioning mysql should login as root user. (It's not linux root user, It's root user of MySQL server). It gives full control of MySQL server.

mysql -u root mysql
highlighted 'mysql' is a database, this database in by default in MySQL server. It have several table.

Set password for MySQL user:

type following command after login in to mysql server,

mysql>SET PASSWORD FOR root@localhost=PASSWORD('rootpass');


SET PASSWORD FOR root@localhost=PASSWORD('rootpass');

highlighted things are queries,

root@localhost, is user name with host address ,

rootpass is password for root login.

No comments: