
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
Installing a MySQL Source Distribution
Let us understand how to install MySQL from a source distribution −
Building MySQL from source
You need the following tools to build and install MySQL from source −
GNU needs to be installed so as to uncompress the distribution. Another ‘tar’ should be installed to unpack the distribution.
ANSI C++ compiler.
A good ‘make’ program. GNU make is recommended
The below commands need to be executed to install a MySQL source distribution from an unpacked ‘tar’ file −
shell> configure shell> make shell> make install shell> scripts/mysql_install_db shell> /usr/local/mysql/bin/safe_mysqld &
If you start from a source RPM, then do the following.
shell> rpm −−rebuild MySQL−VERSION.src.rpm
This will ‘make’ a binary RPM that can be installed by the user.
New users can be added using the bin/mysql_setpermission script if DBI and Msql−MySQL−modules Perl modules are installed.
Let us understand the steps in detail −
To install source distribution, pick a directory where the distribution needs to be unpackged and move there.
The distribution file has to be obtained from one of the sites listed in ‘Getting MySQL’. MySQL source distributions are given as compressed tar archives.
The distribution needs to be unpacked into the current directory using the below command −
shell> gunzip < mysql−VERSION.tar.gz | tar xvf −
This would create a directory named `mysql−VERSION'.
The user has to change into top−level directory of the unpacked distribution using the below command −
shell> cd mysql-VERSION
The release has to be configured, and then compiled, using the below commands −
shell> ./configure −−prefix=/usr/local/mysql shell> make
When ‘configure’ is run, certain options can be specified. Install everything using the below command, and ensure that it is run as root −
shell> make install
MySQL grant tables need to be created if MySQL is being installed for the first time −
shell> scripts/mysql_install_db
Once this is done, initialize and test the distribution to ensure everything works fine.
- Related Articles
- Installing MySQL from Source
- Installing MySQL from source on linux
- Installing MySQL on macOS
- Installing MySQL on Linux
- Installing MySQL on Solaris
- Installing MySQL on FreeBSD
- Installing MySQL on Microsoft Windows
- Installing MySQL Using Unbreakable Linux Network (ULN)
- Installing MySQL on Unix/Linux Using Generic Binaries
- Which MySQL Version and Distribution to Install?
- Installing Linux Packages Inside a Docker Container
- Replacing/Installing a license in SAP HANA
- Installing Python on Linux
- Installing Python on Windows
- Installing a new library in Arduino IDE 2.0
