Home  >  Article  >  Database  >  Install the MySQL source code distribution

Install the MySQL source code distribution

王林
王林forward
2023-09-02 20:53:06513browse

安装 MySQL 源代码发行版

Let us understand how to install MySQL from source distribution −

Build MySQL from source

You will need the following tools to build And installing MySQL −

  • requires GNU to be installed to unpack the distribution. Another 'tar' should be installed to unpack the distribution.

  • ANSI C compiler.

  • A good 'make' program. GNU make is recommended Do the following.

    shell> configure
    shell> make
    shell> make install
    shell> scripts/mysql_install_db
    shell> /usr/local/mysql/bin/safe_mysqld &
  • This will create a binary RPM that users can install and use.

If the DBI and Msql-MySQL-modules Perl modules have been installed, you can use the bin/mysql_setpermission script to add new users.

Let us know the following steps in detail -

To install the source code distribution, select a directory, unzip the distribution and move it to that directory.

    The distribution files must be obtained from one of the sites listed in "Get MySQL". MySQL source code distributions are provided as compressed tar archives.
  • Extract the distribution to the current directory using the following command -
  • shell> rpm −−rebuild MySQL−VERSION.src.rpm
  • This will create a file called "mysql -VERSION" directory.

    The user must change to the top level directory to unpack the distribution using the following command -
  • shell> gunzip < mysql&minus;VERSION.tar.gz | tar xvf &minus;
  • The distribution must use the following command Configuring and Compiling −

shell> cd mysql-VERSION
  • When running "configure", you can specify certain options. Install everything using the following command and make sure it is running as root -

shell> ./configure &minus;&minus;prefix=/usr/local/mysql
shell> make
  • If you are installing MySQL for the first time, you will need to create the MySQL authorization table -

shell> make install
    Once completed, initialize and test the distribution to make sure everything is working properly.

The above is the detailed content of Install the MySQL source code distribution. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete