Board index Linux Mysql

Moderator: chandranjoy

MySQL Installation

Postby chandranjoy » Mon Mar 01, 2010 4:20 am

MySQL Installation steps:

Two types of mysql server downloads are available

* MySql Community Server – For users or organizations looking to
maintain their own solutions(Free under GPL).
* MySql Enterprise Server – For businesses, public sector institutions
and users looking for the highest reliability in software and services
(Licensed).

distribution to download and use:
* Choosing which version to install
* Choosing between binary and source distributions

Choosing Which Version to Install

MySQL AB currently makes the following two versions of the MySQL database
server available on its web site:

* MySQL Standard This is the standard version of the MySQL database
server, which includes support for both the regular, non-transactional
tables and the newer, transaction-safe tables. It is suited for
production environments requiring a stable, flexible, and robust
database engine.

* MySQL Max This version includes the feature set of the standard
version, together with newer, more experimental capabilities. It is
not always best suited for production environments, since it usually
includes a fair share of not-completely-stable enhancements.

***Here, for Production Servers MySQL Standard is recommnded***

Make sure you have superuser (root) privileges and user “mysql” already
exists in your system. If not, create one:
# groupadd mysql
# useradd -g mysql mysql

This will be the default user under which the MySQL server will be running.
download the source

First, download MySQL source . You need the mysql-5.0.37.tar.gz tarball file.
unpack, configure, compile

So you have downloaded the mysql-5.0.37.tar.gz file. You know the drill:
unpack, configure, make, make install:.
# tar -xzf mysql-5.0.37.tar.gz
# cd mysql-5.0.37
# ./configure –prefix=/usr/local/mysql-5.0.37 –with-charset=utf8
–with-collation=utf8_general_ci
# make
# make install


Here used the –with-charset and –with-collation options to set the
default character set and collation – otherwise it would have been the
default Swedish collation.

It is recommended creating a symbolic link called “mysql” pointing to the
MySQL installation directory, in order to make referring to it from
elsewhere easier:
# ln -s /usr/local/mysql-5.0.37/ /usr/local/mysql


This way we can always refer to MySQL installation directory as
/usr/local/mysql . The obvious advantage is that if you install PHP with
the –with-mysql=/usr/local/mysql option (see PHP 5 Installation Guide),
it won’t stop working if the name of the MySQL installation directory
changes in the future (if you upgrade your MySQL for instance).
create my.cnf file

To complete MySQL server installation, you have to create a configuration
file. It offers several security and control options (here you can limit
system resources to be used by MySQL server, set the default collation and
character set etc.). You need not to create a brand new configuration file
– there are 4 pre-made files in the support-files/ directory. Read the
information in those files to determine which one to use. For small
servers (e.g. testing servers, or servers of a limited performance),
my-small.cnf file is the best option. Copy the file of your choice to
/etc/my.cnf:
# cp support-files/my-small.cnf /etc/my.cnf
# chown root /etc/my.cnf
# chgrp root /etc/my.cnf
# chmod 644 /etc/my.cnf


We have made sure both the owner and user group of the my.cnf file are
“root” and the access privileges are properly set. Finally edit the file:
# vi /etc/my.cn
f

Search for [mysqld] clause, and add immediately below it:
user = mysql


We have specified that MySQL service is to be run with user “mysql”
privileges.

If you want to use InnoDB databases (what you probably will), uncomment
(and perhaps edit) all innodb options in the my.cnf file. Save all changes
(<ESC> :wq).
additional settings

For proper functioning, MySQL needs a “mysql” database. To create this
database, simply run:
# /usr/local/mysql/bin/mysql_install_db –user=mysql


The script will create /usr/local/mysql/var/ directory containing the
necessary databases. This directory serves as a default storage for all
databases you will create. Make sure it is writable by “mysql” system
user!
start server, check it, connect

Now you are ready to start your MySQL server for the first time.
# /usr/local/mysql/bin/mysqld_safe –user=mysql &


Hit enter again to get your prompt back. The MySQL server should now be
running. To check that server is running and works properly enter
# /usr/local/mysql/bin/mysqladmin version
chandranjoy
Site Admin
 
Posts: 283
Joined: Fri Oct 23, 2009 11:19 pm

Return to Mysql

Who is online

Users browsing this forum: No registered users and 1 guest


cron