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

About MySQL - Database history Support and Versioning

About MySQL: MySQL was created by a Swedish company. David Axmark (left) and Michael "Monty" Widenius,  MySQL AB, founded by David Axmark, Allan Larsson and Michael "Monty" Widenius. Original development of MySQL by Widenius and Axmark began in 1994. The first version of MySQL appeared on 23 May 1995. It was initially created for personal usage from mSQL based on the low-level language ISAM, which the creators considered too slow and inflexible. They created a new SQL interface, while keeping the same API as mSQL. By keeping the API consistent with the mSQL system, many developers were able to use MySQL instead of the (proprietarily licensed) mSQL antecedent. Support: The MySQL server software itself and the client libraries use dual-licensing distribution. They are offered under GPL version 2, or a proprietary license. MySQL AB owns the copyright to the MySQL source code. This means that MySQL AB can distribute MySQL under several different l...

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

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