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

Installation steps of mysql source code under Liunx

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

Share

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

This article mainly explains the "Liunx mysql source code installation steps", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "mysql source code installation steps under Liunx"!

Environment:

Virtual machine: CentOS-6.6-x86_64

Mysql installation package: mysql-5.6.34

Before installing the source package, you need to install some rpm packages

[root@potato ~] # rpm-qa | grep cmake

Cmake-2.8.12.2-4.el6.x86_64

[root@potato ~] # rpm-qa | grep gcc

Gcc-4.4.7-11.el6.x86_64

Gcc-c++-4.4.7-11.el6.x86_64

[root@potato ~] # rpm-qa | grep make

Make-3.81-20.el6.x86_64

[root@potato ~] # rpm-qa | grep make

[root@potato ~] # rpm-qa | grep libaio-devel

Libaio-devel-0.3.107-10.el6.x86_64

Create user mysql

[root@potato ~] # useradd mysql

Download the mysql database source code package from the official website at:

Http://dev.mysql.com/downloads/mysql/

Extract the downloaded tar package

[root@potato ~] # cd Desktop/

[root@potato Desktop] # tar-zxvf / tmp/soft

Create a software storage directory

[root@potato Desktop] # mkdir / opt/mysql/mysql-5.6

[root@potato Desktop] # cd / tmp/soft

[root@potato soft] # cd mysql-5.6.34/

[root@potato mysql-5.6.34] # mkdir temp

Start compilation and specify the software storage directory

[root@potato temp] # cmake-DBUILD_CONFIG=mysql_release-DCMAKE_INSTALL_PREFIX=/opt/mysql/mysql-5.6.

[root@potato temp] # make-j

[root@potato temp] # make install

Since then, the mysql software installation is complete.

Configure the mysql soft connection under the / usr/local directory and set the PATH variable

[root@potato unbx] # cd / usr/local/

[root@potato local] # ln-s / opt/mysql/mysql-5.6 mysql

[root@potato local] # echo "PATH=$PATH:/usr/local/mysql/bin" > > / etc/profile

[root@potato local] # source / etc/profile

[root@potato mysql] # echo $PATH

/ usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/root/bin:/usr/local/mysql/bin

Create a data directory and give it weight

[root@potato local] # mkdir-p / data/mysql/mytest_3306

[root@potato local] # chown-R mysql:mysql / data/mysql/mytest_3306

[root@potato local] # cd / usr/local/mysql

[root@potato mysql] # chown-R mysql:mysql *

Create a profile my.cnf

[root@potato mysql] # cd / etc

[root@potato mysql] # vi / etc/my.cnf

Note: you can automatically generate my.cnf step by step in https://tools.percona.com

Initialize the database and specify the my.cnf file

[root@potato mysql] # / scripts/mysql_install_db-- defaults-file=/etc/my.cnf-- user=mysql

Copy mysql.server to the / etc/init.d directory and open the mysql service

[root@potato mysql] # cp support-files/mysql.server / etc/init.d/mysql

[root@potato mysql] # / etc/init.d/mysql start

Starting MySQL... SUCCESS!

Connect mysql

[root@potato mysql] # mysql

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 1

Server version: 5.6.34-log Source distribution

Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

Affiliates. Other names may be trademarks of their respective

Owners.

Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.

Root@localhost:mysql.sock 14:22:29 [(none)] >\ s

-

Mysql Ver 14.14 Distrib 5.6.34, for Linux (x86 / 64) using EditLine wrapper

Connection id: 1

Current database:

Current user: root@localhost

SSL: Not in use

Current pager: stdout

Using outfile:''

Using delimiter:

Server version: 5.6.34-log Source distribution

Protocol version: 10

Connection: Localhost via UNIX socket

Server characterset: utf8

Db characterset: utf8

Client characterset: utf8

Conn. Characterset: utf8

UNIX socket: / tmp/mysql.sock

Uptime: 1 min 12 sec

Threads: 1 Questions: 6 Slow queries: 0 Opens: 70 Flush tables: 1 Open tables: 63 Queries per second avg: 0.083

-

Thank you for reading, the above is the content of "mysql source installation steps under Liunx". After the study of this article, I believe you have a deeper understanding of the installation steps of mysql source code under Liunx, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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