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

MySQL thread error code of 1032- Translate binlog completely to avoid error

Could not execute Update_rows event on table db.table; Can't find record in 'table', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's   master log mysql-bin.262297, end_log_pos 1983208 As of my knowledge the causing stop of slave SQL thread error code of 1032, due to lack of sync between Master - Slave. In our case, slave got an Update event form master, but that particular record was not available in the slave. (Of course, that was deleted on Master n Slave separately) You would get this error only if the binlog_format is set to ROW_BASED or MIXED mode. So, now check that particular binlog at that position where replication stopped with this error. When you convert the binlog with mysqlbinlog command, you may see some junk characters   where you were expecting some DMLs which caused the error(In our case its an Update statement). So you can use below command to translate binlog completely: mysqlbinlog --base64-output=DECO...

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...