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

Detailed explanation of compilation and installation of MySQL5.6 binary package (3)

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

Share

Shulou(Shulou.com)06/01 Report--

1. Software environment [root@localhost ~] # uname-r3.10.0-862.el7.x86_64 [root@localhost ~] # cat / etc/redhat-release CentOS Linux release 7.5.1804 (Core) 2. Details of installation and deployment process: MySQL installation:

1 > rpm package installation

Application files are installed in the / usr/local directory by default

2 > Source code compilation

Need to customize file paths and parameters

3 > binary compilation-free mode

The advantage is that the file installation path can be specified, and there is no dependency package problem. Download the installation package to / usr/local/src [root@localhost ~] # cd / usr/local/src/ [root@localhost src] # wget http://mirrors.163.com/mysql/Downloads/MySQL-5.6/mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz

Extract the tar installation package [root@localhost src] # tar-zxvf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz

Check to see if there is an error in the decompression process

[root@localhost src] # echo $? 0

Note: return 0 means decompression is successful, otherwise decompression fails

When you move the rename, note that when you execute this command, under / usr/local/ is [root@localhost src] # mv mysql-5.6.39-linux-glibc2.12-x86_64 / usr/local/mysql [root@localhost src] # lltotal 321176Muhashi-1 root root 328882304 Dec 9 2017 mysql-5.6.39-linux-glibc2.12-x86_ 64.tar.gz [root @ localhost src] # ll / usr/local/mysql/

5. Create mysql users and user groups

[root@localhost src] # cd / usr/local/mysql/ [root@localhost mysql] # useradd mysql

6. Create a database directory / data/mysql

[root@localhost mysql] # mkdir / data/mysql

7. Initialize the database

[root@localhost mysql] # / scripts/mysql_install_db-- user=mysql-- datadir=/date/mysqlFATAL ERROR: please install the following Perl modules before executing. / scripts/mysql_install_db:Data::Dumper

Error analysis:

Initializing the mysql database reported this error due to the lack of the Data::Dumper module

Solution 1: install the aotuconflibrary

Yum-y install autoconf

Solution 2: fuzzy search for perl and dumper software packages

[root@localhost mysql] # yum list | grep perl | grep-I dumper

There are four Dumper-related software packages. If you do not know which package is missing, it is recommended that you install each package in turn by yum, and then execute the database initialization command to see the result returned.

By executing the database initialization command, we can judge whether the database initialization is successful or not from two aspects.

a. There are two OK during database initialization.

b. Execute echo $? Whether the return value is 0

Description: echo $? The function of is to check the execution status of the previous command and return 0 for success and non-0 for failure

8. Copy the profile template for mysql5.6

[root@localhost mysql] # cp. / support-files/my-default.cnf / etc/my.cnf Editor / etc/my.cnfdatadir = / data/mysqlsocket = / tmp/mysql.sock

9. Move the startup script of the mysql5.6 database to / etc/init.d/mysqld

Edit the database startup script / etc/init.d/mysqld, and change the basedir=datadir= parameter to basedir=/usr/local/mysqldatadir=/data/mysql

On centos7.5, if you want to add the mysql database startup script to the system boot, execute the following command

10. Start the MySQL database and execute

[root@localhost mysql] # service mysqld startStarting MySQL.Logging to'/ data/mysql/localhost.localdomain.err'. SUCCESS! Or [root@localhost mysql] # / etc/init.d/mysqld restartShutting down MySQL.. SUCCESS!Starting MySQL. SUCCESS! [root@localhost mysql] # you can view the mysql database process [root@localhost mysql] # ps-ef | grep mysqld

The port for checking database monitoring is 3306 [root@localhost mysql] # netstat-nlpt

11. Start the mysql service from the command line

[root@localhost mysql] # / usr/local/mysql/bin/mysqld_safe-- datadir=/data/mysql-- pid-file=/data/mysql/localhost.localdomain.pid & [root@localhost ~] # ps-ef | grep mysqldroot 20630 17325 0 02:09 pts/0 00:00:00 / bin/sh / usr/local/mysql/bin/mysqld_safe-- datadir=/data/mysql-- pid-file=/data/mysql/localhost.localdomain.pidmysql 20767 20630 0 02:09 pts/ 0 00:00:00 / usr/local/mysql/bin/mysqld-basedir=/usr/local/mysql-- datadir=/data/mysql-- plugin-dir=/usr/local/mysql/lib/plugin-- user=mysql-- log-error=localhost.localdomain.err-- pid-file=/data/mysql/localhost.localdomain.pid-- socket=/tmp/mysql.sockroot 20861 20802 0 02:10 pts/1 00:00:00 grep-- color=auto mysqld

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