Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mysql 5.6.24 how to compile and install source code

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces mysql 5.6.24 how to compile and install the source code, the content is very detailed, interested friends can refer to, hope to help you.

Environment:

System platform RedHat 6.4

Installation process:

1. Install cmake

Download address of cmake: https://cmake.org/download/

There will be two formats of cmake installation packages, choose Source distributions.

I didn't choose the latest version, I downloaded the cmake-3.5.2 version.

Installation process:

Tar-zxvf cmake-3.6.1.tar.gz

Cd cmake-3.5.2

. / bootstrap

Make

Make install

2. Install mysql

Download the source code package for mysql. The source installation package for mysql 5.6.24 is no longer available on the official website. I found it on csdn.

Tar-zxvf mysql-5.6.24.tar.gz

Cd mysql-5.6.24

Cmake\

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql\

-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock\

-DDEFAULT_CHARSET=utf8\

-DDEFAULT_COLLATION=utf8_general_ci\

-DWITH_MYISAM_STORAGE_ENGINE=1\

-DWITH_INNOBASE_STORAGE_ENGINE=1\

-DWITH_ARCHIVE_STORAGE_ENGINE=1\

-DWITH_BLACKHOLE_STORAGE_ENGINE=1\

-DWITH_MEMORY_STORAGE_ENGINE=1\

-DWITH_READLINE=1\

-DENABLED_LOCAL_INFILE=1\

-DMYSQL_DATADIR=/usr/local/mysql/data\

-DMYSQL_USER=mysql\

-DMYSQL_TCP_PORT=3306

Make

Make install

The waiting time for the above steps is relatively long.

If the above compilation is not successful, you can recompile it. However, you need to clear the old object files and cache information:

Make clean

Rm-f CMakeCache.txt

Modify the owner of the directory:

Chown-R mysql:mysql / usr/local/mysql

Chown-R mysql:mysql / usr/local/mysql/data

Execute the initialization configuration script to create the database and table that comes with the system:

Cd / usr/local/mysql

Scripts/mysql_install_db-user=mysql

The initialization script also generates a configuration file at / usr/local/mysql/my.cnf. The owner of the profile needs to be changed:

Chown-R mysql:mysql / usr/local/mysql

Add the startup service of mysql to the system service:

Cp / usr/local/mysql/support-files/mysql.server / etc/init.d/mysql

Cp / usr/local/mysql/support-files/my-default.cnf / etc/my.cnf

Set the environment variable for the root user, and change the path variable to:

PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib

3. Other:

During initialization, mysql gives the root user a password by default. The password needs to be changed.

Start the mysql service first:

Service mysql start

Change the root user password to new-password:

. / usr/local/mysql/bin/mysqladmin-u root password' new-password'

On mysql 5.6.24 how to compile and install the source code to share here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report