Skip to main content

MySQL Source Installation on linux

 1. Ensure that you’re logged in as root:
[user@host]# su - root

2. Switch to the directory containing the source tarball, and extract the files within it. (Note that you will need approximately 80 MB of free space for the source tree.)
[root@host]# cd /tmp
[root@host]# tar -xzvf mysql-4.0.9-gamma.tar.gz
Remember to replace the file name in italics with the file name of your source tarball.

3. Move into the directory containing the source code,
[root@host]# cd mysql-4.0.9-gamma
and take a look at the contents with ls:
[root@host]# ls -l
Take a look at the sidebar entitled “Up a Tree” for more information on what each directory contains.

4. Now, set variables for the compile process via the included configure script. (Note the use of the --prefix argument to configure, which sets the default installation path for the compiled binaries.)
[root@host]# ./configure --prefix=/usr/local/mysql

5. Now compile the program using make:
[root@host]# make
The compilation process takes a fair amount of time (refer to the sidebar titled “Watching the Clock” for my empirical observations on how long you’ll be waiting), so this is a good time to get yourself a cup of coffee or check your mail.
Now that you’re all done, you can test to ensure that everything is working properly.

6. Run the following command:
[root@host]# make tests
Handcrafting Your Build
You can pass configure a number of command-line options that affect the build process. Here’s a list of the more interesting ones:
·          --prefix  Sets the prefix for installation paths
·          --without-server  Disables compilation of the server, and compiles only the MySQL client programs and libraries
·          --localstatedir  Sets the location in which the MySQL databases will be stored
·          --with-charset  Sets a default character set
·          --with-debug  Turns on extended debugging
·          --with-raid  Enables RAID support
·          --with-embedded-server  Builds the libmysqld embedded server library
·          --without-query-cache  Disables the query cache
·          --without-debug  Disables debugging routines
·          --with-openssl  Includes OpenSSL support
Use the configure --help command to get a complete list of options.

Watching the Clock
Compiling MySQL is a fairly time-consuming process, and you should be prepared to spend anywhere between 15 to 60 minutes on the task. The following table contains some empirical observations on the time taken to compile the program on various hardware configurations:
System Configuration
Time Taken to Compile MySQL
Pentium-II@350 MhZ, 64 MB RAM
45 minutes
Pentium-III@700MhZ, 256 MB RAM
30 minutes
AMD Athlon MP 1500+, SuSE Linux 7.3
8 minutes
AMD Opteron@2x1.6 GHz, UnitedLinux 1.0
7 minutes
Apple PowerMac G4@2x1.2 GHz, Mac OS X 10.2.4
14 minutes
Compaq AlphaServer DS20@500 MHz, SuSe Linux 7.0
17 minutes
HP 9000/800/A500-7X, HP-UX 11.11
14 minutes
IBM RS/6000, AIX 4.3.3
35 minutes
Intel Itanium2@900 MHz, Red Hat AS 2.1
14 minutes
MIPS R5000@500 MHz, SGI IRIX 6.5
2 hours 30 minutes

7. Install the MySQL binaries to their new home in /usr/local/mysql:
[root@host]# make install
Figure 8 demonstrates what your screen should look like during the installation process.

8. Create the special mysql user and group with the groupadd and useradd commands:
[root@host]# groupadd mysql
[root@host]# useradd -g mysql mysql

9. Run the initialization script, mysql_install_db, which ships with the program, to prepare MySQL for operation:
[root@host]# /usr/local/mysql/scripts/mysql_install_db

10. Alter the ownership of the MySQL binaries so that they are owned by root:
[root@host]# chown -R root /usr/local/mysql
Now ensure that the newly minted mysql user has read/write access to the MySQL data directories:
[root@host]# chown -R mysql /usr/local/mysql/var
[root@host]# chgrp -R mysql /usr/local/mysql

11. Start the MySQL server by manually running the mysqld daemon:
[root@host]# /usr/local/mysql/bin/mysqld_safe –-user=mysql &
MySQL should start up normally, reading the base tables created in /usr/local/mysql/var.
At this point, you can proceed to the section titled “Testing MySQL” to verify that everything is working as it should.

Comments

Popular posts from this blog

Mongodb online Training course Agenda

  Goal:   In this module, you will get an understanding of NoSQL databases, design goals, requirement of NoSQL database/ MongoDB, MongoDB® architecture and introduction to JSON and BSON among others. This module will also cover the installation of MongoDB® and associated tools. Skills Understand NoSQL databases and  advantages Install MongoDB on Windows and Linux platform Security Enable and high availability Objectives After completing this module, you will  be able knowledge ed on SQL and noSQL Database usages and difference between these MongoDB design and architecture  MongoDB GUI tools Describe JSON and BSON Install MongoDB on Windows, Linux, MAC OS etc.  Setup MongoDB environment Topics • Understanding the basic concepts of a Database • Database categories: What is NoSQL? Why NoSQL? Benefit over RDBMS  • Types of NoSQL Database, and NoSQL vs. SQL Comparison, ACID & Base Property • CAP Theorem, implementing NoSQL and what is MongoDB?  • O...

Linux Commands With Examples for Database Admins

Frequently Used Linux Commands With Examples 1. tar command examples Create a new tar archive. $ tar cvf archive_name.tar dirname/ Extract from an existing tar archive. $ tar xvf archive_name.tar View an existing tar archive. $ tar tvf archive_name.tar More tar examples: The Ultimate Tar Command Tutorial with 10 Practical Examples 2. grep command examples Search for a given string in a file (case in-sensitive search).  $ grep -i "the" demo_file Print the matched line, along with the 3 lines after it. $ grep -A 3 -i "example" demo_text Search for a given string in all files recursively $ grep -r "ramesh" * More grep examples: Get a Grip on the Grep! – 15 Practical Grep Command Examples 3. find command examples Find files using file-name ( case in-sensitve find) # find -iname "MyCProgram.c" Execute commands on files found by the find command $ find -iname "MyCProgram.c" -exec md5sum {} \; Find all empty...

MySQL Architecture -Client Server Architecture

Client/Server Overview The MySQL database system operates using a client/server architecture. The server is a central program that manages database contents, and client programs connect to the server to retrieve or modify the data. MySQL also includes non-client utility programs and scripts. MySQL Server:   This is the mysqld program that manages database and tables. Most users choose binary MySQL distribution that includes a server ready to run with the capabilities they need, but it's also possible to compile MySQL from source. Client Programs:  These are programs that communicate with the server by sending requests to it over a network connection. The server acts on each request and returns a response to the client. For example you can use the mysql client to send queries to the server, and the server returns the query results. A client program can connect locally to a server running on the same machine or remotely to a server running on a different mac...