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

CentOS 7.4.Custom single instance binary installation of mysql5.6.39

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

Share

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

System platform: CentOS release 7.4 (Final) kernel 3.10.0-693.el7.x86_641. Go to the official website to download the binary package

Https://dev.mysql.com/downloads/mysql/

two。 Create an account and group # getent group mysql > / dev/null for launching mysql | | groupadd mysql#getent passwd mysql > / dev/null | | useradd-g mysql-r-s / sbin/nologin mysql3. Extract the package to / usr/local#tar xvf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz-C / usr/local/4. Create a soft link mysql to point to the extracted directory # cd / usr/local/#ln-sv mysql-5.6.39-linux-glibc2.12-x86_64/ mysql5. Modify the owner and group # chown-R mysql.mysql mysql/6 of the mysql folder. Add PATH to the echo 'PATH=/usr/local/mysql/bin:$PATH' > > / etc/profile.d/mysql.sh check file # cat / etc/profile.d/mysql.sh load the environment variable file and check # source / etc/profile.d/mysql.sh#echo $PATH7. Create a database to store folders and related files and modify permissions # mkdir-pv / data/mysqldb/3306/ {logs,bin-logs,run,data} # touch / data/mysqldb/3306/run/mysqld.pid# touch / data/mysqldb/3306/logs/mysql-error.log# chown-R mysql.mysql / data/mysqldb/-R# chmod-R 770 / data/mysqldb/# chown-R mysql.mysql / data/mysqldb/# chmod-R 770 / data/mysqldb file has not been created An error of 8. 0 will be reported when starting Mysql. Modify the configuration file # vim / etc/ my.cnf [client] port = 3306socket = / tmp/mysql.sockdefault-character-set= UTF8 [mysqld] user = mysqlport = 3306basedir=/usr/local/mysqldatadir = / data/mysqldb/3306/datasocket = / tmp/mysql.socklog-bin = / data/mysqldb/3306/bin-logs/mysql-binbinlog_format=mixedsymbolic-links=0innodb_file_per_table = 1skip_name_resolve = 1slow_query_log = 1long_query_time = 2pid-file = / data/mysqldb/3306/run/ Mysqld.pidlog-error = / data/mysqldb/3306/logs/mysql-error.logcharacter-set-server=utf8default-storage-engine= INNODBs [mysqld _ safe] # include all files from the config directoryqualified developers dedir / etc/my.cnf.d9. Initialize the database # cd / usr/local/mysql# bin/mysqld-defaults-file=/etc/my.cnf-user=mysql-datadir=/data/mysqldb/3306/data10. Copy the startup service script to the / etc/init.d directory (pit) use the support-files/mysql.server in the binary installation package this startup script will not start, report the following error Starting MySQL. ERROR! The server quit without updating PID file (/ data/mysqldb/3306/run/mysqld.pid). In desperation, go to the official website of mysql to download a source code package of mysql, and use the mysql.server inside. He he. # cp mysql/support-files/mysql.server / etc/rc.d/init.d/mysqld11. Add boot # chkconfig-- add mysqld# chkconfig mysqld on#chkconfig-- list mysqldmysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off12. Start the mysql service # service mysqld startStarting MySQL. SUCCESS!13. Check and confirm

Check whether port 3306 is open

# ss-ntl | grep 3306LISTEN 0 50 *: 3306 *: *

Confirm the version

# mysql-Vmysql Ver 14.14 Distrib 5.6.39, for linux-glibc2.12 (x86 / 64) using EditLine wrapper14. Perform security configuration # / usr/local/mysql/bin/mysql_secure_installation and follow the prompts for 15. Client connection # mysql-uroot-pEnter password: Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 14Server version: 5.6.39-log MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.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