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

MySQL5.7.20 installation tutorial

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

Share

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

This article mainly introduces the MySQL5.7.20 installation tutorial, which involves things, learned from the theoretical knowledge, there are many books, literature for your reference, from a practical point of view, accumulated years of practical experience can be shared with you.

Source Install MySQL 5.7.20

Use boost1.59 after the mysql5.7 version

Http://www.boost.org/

Yum-y install gcc gcc-c++ ncurses ncurses-devel cmake bison wget

Wget https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz & & wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-boost-5.7.20.tar.gz

Tar xf boost_1_59_0.tar.gz & & tar xf mysql-boost-5.7.20.tar.gz

Cd mysql-5.7.20

Groupadd mysql

Useradd mysql-s / bin/nologin-M-g mysql

Mkdir-p / usr/local/mysql-5.7.20/ usr/local/mysql-5.7.20/data / usr/local/mysql-5.7.20/mysql.sock

Cmake. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.7.20\

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

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

-DSYSCONFDIR=/etc\

-DWITH_BOOST=../boost_1_59_0\

-DDEFAULT_CHARSET=utf8\

-DDEFAULT_COLLATION=utf8_general_ci\

-DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii\

-DENABLED_LOCAL_INFILE=ON\

-DWITH_INNOBASE_STORAGE_ENGINE=1\

-DWITH_FEDERATED_STORAGE_ENGINE=1\

-DWITH_BLACKHOLE_STORAGE_ENGINE=1\

-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1\

-DWITHOUT_PARTITION_STORAGE_ENGINE=1\

-DWITH_FAST_MUTEXES=1\

-DWITH_ZLIB=bundled\

-DENABLED_LOCAL_INFILE=1\

-DWITH_READLINE=1\

-DWITH_EMBEDDED_SERVER=1\

-DWITH_DEBUG=0

Compilation and installation

Make-j `grep processor / proc/cpuinfo | wc-l`

Make install

Set up startup script, boot self-boot

Ls-lrt / usr/local/mysql

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

Chmod + x / etc/init.d/mysqld

Configuration file

/ etc/my.cnf

Cat > / etc/my.cnf > / etc/profile & & source / etc/profile

Initialize the database

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

Start the database

Systemctl start mysqld

Systemctl status mysqld

View MySQL service processes and ports

Ps-ef | grep mysql

Set the database root user password

Mysql_secure_installation

Common operation

Share the dynamic link library of the MySQL database to the system link library

In general, MySQL databases are also called by services such as PHP, so we need to add the MySQL compiled lib library file to the current Linux host link library / etc/ld.so.conf.d/

So that MySQL services can be invoked by other services.

Ldconfig | grep mysql

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

Ldconfig

Ldconfig-v | grep mysql

Access to the database

Mysql-uroot-p

Show databases

Quit

Read the above MySQL5.7.20 installation tutorial introduction, hope to give you in the practical application of some help. Due to the limited space in this article, there will inevitably be deficiencies and areas that need to be supplemented. You can continue to pay attention to the industry information section and will update your industry news and knowledge regularly. 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

Database

Wechat

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

12
Report