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

How to compile and install MySQL for CentOS

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article introduces the relevant knowledge of "how CentOS compiles and installs MySQL". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Previously, the systems installed in the virtual machine were all ubuntu, but later my colleague said that most servers were installed with centos, so I flipped the centos system again. Www.2cto.com

Of course, the first step is to build a PHP environment. Mysql, version 5.5.25, the latest seems to be 5.5.4. Remember here, be sure to download the source code. When you download it on the mysql website, you will be prompted to select the platform and choose the bottom Source Code in the drop-down menu.

Boot mysql does not start after following the previous steps of ubuntu installation. The error code is "The server quit without updating PID file (/ var/lib/mysql/CentOS.pid)". Baidu and google have searched for some information, which is basically the same, which is not helpful to me, and it is not possible to modify it according to what they say. So combined with Zhang Yan's blog, it was finally successfully completed.

Step 1: we first install dependent libraries and development tools

# dependent libraries and development tools

Yum-y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers

Www.2cto.com

# Nginx

Yum-y install pcre-devel zlib-devel

# Php

Yum-y install gd-devel libjpeg-devel libpng-devel freetype-devel libxml2-devel curl-devel freetype-devel

# Mysql

Yum-y install bison gcc gcc-c++ autoconf automake zlib* libxml* ncurses-devel libtool-ltdl-devel* mysql-devel

Step 2: since mysql5.5 starts, instead of using configure installation, you will use cmake. So you need to install cmake first.

Wget http://www.cmake.org/files/v2.8/cmake-2.8.6.tar.gz

Tar-zxvf cmake-2.8.6.tar.gz

Cd cmake-2.8.6/

. / configure

Make & & make install

Step 3: cmake install mysql (I have downloaded the mysql source file, put it on a USB drive, and copied it to the / tmp directory)

/ / enter / tmp directory

Tar-zxvf mysql-5.5.25.tar.gz

Cd mysql-5.5.25

Www.2cto.com

Cmake\

-DCMAKE_INSTALL_PREFIX=/usr/local/webserver/mysql\

-DMYSQL_DATADIR=/user/local/webserver/mysql/data\

-DSYSCONFDIR=/etc\

-DEXTRA_CHARSETS=all\

-DDEFAULT_CHARSET=utf8\

-DDEFAULT_COLLATION=utf8_general_ci\

-DWITH_INNOBASE_STORAGE_ENGINE=1\

-DWITH_ARCHIVE_STORAGE_ENGINE=1\

-DWITH_BLACKHOLE_STORAGE_ENGINE=1\

-DWITH_FEDERATED_STORAGE_ENGINE=1\

-DWITH_PARTITION_STORAGE_ENGINE=1\

-DWITH_PERFSCHEMA_STORAGE_ENGINE=1\

-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock\

-DMYSQL_TCP_PORT=3306\

-DWITH_DEBUG=0\

-DENABLED_LOCAL_INFILE=1

Enter to execute, and continue to execute make & & make install after the execution is completed.

Step 4: set up mysql

# set Mysql

# there are five configuration information files in the support-files directory (here it is important to copy the corresponding cnf file according to your own memory, otherwise the mysql will never get up): www.2cto.com

# my-small.cnf (memory show variables like'% character%'

/ / result: both character_set_database,character_set_server items have become utf8.

That's all for "how CentOS compiles and installs MySQL". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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