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

Mysql 5.7Database installation and deployment

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

Share

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

1. Installation depends on the environment:

Yum-y install libaio libaio-devel libtool make automake autoconf numactl numactl-devel bzip2 gcc gcc-c++ perl perl-DBI perl-ExtUtils-MakeMaker perl-devel perl-Time-HiRes perl-DBD-MySQL pcre-devel time jemalloc gperf cmake zlib-devel openssl-devel readline-devel readline glib2-devel mysql-devel qpress which netstat

Wget http://repositories.voole.com/jemalloc-4.0.4.tar.bz2

Tar xjf jemalloc-4.0.4.tar.bz2

Cd jemalloc-4.0.4

. / autogen.sh

Make & & make install

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

Ldconfig

Download the binary package and deploy:

Cd / opt/soft

Wget http://repositories.voole.com/Percona-Server-5.7.21-20-Linux.x86_64.ssl101.tar.gz

Tar zxvf Percona-Server-5.7.21-20-Linux.x86_64.ssl101.tar.gz

Mv Percona-Server-5.7.21-20-Linux.x86_64.ssl101 / usr/local/mysql

Create a mysql user group

Groupadd mysql & & useradd-g mysql-M-s / sbin/nologin mysql

Create a database file, my.cnf, and put it in the program directory

Mv / etc/my.cnf / etc/my.cnf.bak

SSD solid state disk: wget http://repositories.voole.com/my57_19.cnf-O / etc/my.cnf

SATA disk: wget http://repositories.voole.com/my57_19_sata.cnf-O / etc/my.cnf

Slave library: wget http://repositories.voole.com/my_slave.cnf-O / etc/my.cnf

Main library: wget http://repositories.voole.com/my_master.cnf-O / etc/my.cnf

5. initialize, remember to add the configuration file

/ usr/local/mysql/bin/mysqld-defaults-file=/etc/my.cnf-initialize

VI. Setting environment variables

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

Which mysql

7. Modify the main subordinate group

Chown-R mysql.mysql / opt/mysql_data

Start the mysql5.7 service

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

Chmod 755 / etc/init.d/mysql

/ etc/init.d/mysql start

9. Reset the password (unlike other versions of mysql5.7, the initial installation will generate a random password in the / opt/mysql_data/ logerr.errlog)

The password is generated by default in logerr.err.

Set password=password ('123456')

If you need to change the root password again

Update mysql.user set authentication_string=password ('123qwe') where user='root' and Host =' localhost'

10. Set access permissions

Grant all on. To root@ "" identified by "mysql* ()"

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