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

A brief Analysis of the compilation and installation process of mysql5.7

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces the mysql5.7 compilation and installation process, hoping to supplement and update some knowledge, if there are other problems you need to know, you can continue to follow my updated article in the industry information.

Mysql5.7 compilation and installation process

Mkdir-p / data/ {mysql,conf}

Download the mysql5.7 source code package

Cd / usr/local/src

Wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.22.tar.gz

Tar xf mysql-5.7.22.tar.gz

Download boost

Wget http://www.sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz

Tar-zxvf boost_1_59_0.tar.gz-C / usr/local

Mv / usr/local/boost_1_59_0 / usr/local/boost

# installation

Yum-y groupinstall "Development tools"

Yum-y install wget iproute iotop mtr perf telnet dstat iftop vim cmake gcc gcc-c++ bison ncurses ncurses-devel

Yum-y install libxml2 libxml2-devel openssl-devel bzip2 bzip2-devel libcurl-devel libjpeg libjpeg-devel libpng-devel libicu-devel libmcrypt-devel freetype-devel libtidy libtidy-devel ImageMagick-devel mhash mhash-devel pcre-devel libzip postgresql-devel

Groupadd-g 306 mysql

Useradd-g mysql-u 306-s / sbin/nologin-M mysql

Mkdir / data/mysql-pv

Chown-R mysql.mysql / data/mysql

Cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql-DMYSQL_DATADIR=/data/mysql-DWITH_BOOST=/usr/local/boost-DSYSCONFDIR=/etc-DWITH_INNOBASE_STORAGE_ENGINE=1-DWITH_PARTITION_STORAGE_ENGINE=1-DWITH_FEDERATED_STORAGE_ENGINE=1-DWITH_BLACKHOLE_STORAGE_ENGINE=1-DWITH_MYISAM_STORAGE_ENGINE=1-DENABLED_LOCAL_INFILE=1-DENABLE_DTRACE=0-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci-DWITH_EMBEDDED_SERVER=1

Make & & make install

# set permissions

Chown-R mysql:mysql / data/mysql

Add Profil

Vim / etc/my.cnf

[mysqld]

Port=3306

Basedir=/usr/local/mysql

Datadir=/data/mysql

Character-set-server=utf8

Default-storage-engine=InnoDB

Max_connections=5120

Query_cache_size=0

Tmp_table_size=18M

Log-error = / data/mysql/mysql-error.log

Thread_cache_size=8

Myisam_max_sort_file_size=64G

Myisam_sort_buffer_size=35M

Key_buffer_size=25M

Read_buffer_size=64K

Read_rnd_buffer_size=256K

Sort_buffer_size=256K

Innodb_flush_log_at_trx_commit=1

Innodb_log_buffer_size=1M

Innodb_buffer_pool_size=47M

Innodb_log_file_size=24M

Innodb_thread_concurrency=8

Initialize mysql

/ usr/local/mysql/bin/mysqld-initialize-insecure-user=mysql-basedir=/usr/local/mysql-datadir=/data/mysql

Add MySQL environment variable

Echo "export PATH=/usr/local/mysql/bin:$PATH" > > / etc/profile

Source / etc/profile

Export header file

Ln-sv / usr/local/mysql/include / usr/include/mysqld

Export library files

Echo "/ usr/local/mysql/lib" > / etc/ld.so.conf.d/mysql.conf

Ldconfig

Add startup script

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

Chmod + x / etc/init.d/mysqld

Chkconfig-add mysqld

Start the service. After starting the service, you can log in without a password directly. If you cannot log in, continue with the following two steps.

/ etc/init.d/mysqld start

Find the initial password for mysql5.7

Grep "temporary password" / data/mysql/mysql-error.log

2018-09-25T06:30:28.930040Z 1 [Note] A temporary password is generated for root@localhost: Ui4/OupkjroO

Modify the password

Mysql-uroot-pUi4/OupkjroO

Mysql > alter user root@localhost identified by 'yourpassword'

Read the above on the mysql5.7 compilation and installation process brief analysis, hoping to give you some help in practical application. Due to the limited space in this article, it is inevitable that there will be deficiencies and need to be supplemented. If you need more professional answers, you can contact us on the official website for 24-hour pre-sales and after-sales to help you answer questions at any time.

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

Servers

Wechat

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

12
Report