Get the App
SLTechnology News&Howtos  ›  Database  › 

Mysql5.6 installation and deployment

Shulou Source: shulou.com Published: 2022-06-01 22:40:11 11月07日 Update

Mysql5.6 install

Here, the deployment is installed in a precompiled binary mode. Compared with the compilation and installation, it does not need to be compiled and can be used directly after the my.cnf is modified and initialized. This method is recommended for production environments.

Download a file

Domestic mirror source downloads faster, there is no need to go to the official website to download. Cd ~ wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz configuration file preparation here only the necessary parameters for installation and startup will be configured, and the parameters at the production level will not be described here. Cat / etc/ my.cnf [client] port = 3306socket = / data/coohua/mysql/mysql.sockdefault-character-set = UTF8 [mysqld] port = 3306socket = / data/coohua/mysql/mysql.sockbasedir = / app/3rd/mysql/mysqldatadir = / data/coohua/mysql/data/pid-file = / data/coohua/mysql/data/mysqld.piduser = mysqlcharacter-set-server = utf8innodb_large_prefix=onlower_case_table_names = 1server-id = 1 create MySQL user groupadd mysqluseradd-g mysql-M-s / Sbin/nologin mysql create mysql directory mkdir-p / app/3rd/mysqlmkdir-p / data/coohua/mysql prepare tar-zxf mysql-5.6.39-linux-glibc2.12-x86_64.tar.gz-C / app/3rd/mysql/ln-s / app/3rd/mysql/mysql-5.6.39-linux-glibc2.12-x86_64 / app/3rd/mysql/defaultchown-R mysql.mysql / app/3rd/mysql # program directory chown-R / before installation Data/coohua/mysql/ # data directory initialization installation cd / app/3rd/mysql/mysql-5.6.39-linux-glibc2.12-x86_64./scripts/mysql_install_db-- defaults-file=/app/3rd/mysql/default/my.cnf-- user=mysql has the following error prompt please install the following Perl modules before executing scripts/mysql_install_db:

Missing autoconf

Yum-y install autoconf

Error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory

Missing libaio

Yum install-y libaio re-initializes the operation. / scripts/mysql_install_db-- defaults-file=/app/3rd/mysql/default/my.cnf-- user=mysql starts the mysql service / app/3rd/mysql/default/bin/mysqld_safe-- defaults-file=/app/3rd/mysql/default/my.cnf-- user=mysql & change the password. / bin/mysqladmin-S / tmp/mysql.sock-u root-h localhost password 'root' secure mysql -S / tmp/mysql.sock-uroot-hlocalhost-proot delete from mysql.user where password='' # Delete password-free user drop database test; # Delete test database

So far, the mysql5.6 version has been installed, but it is only installed, and there are a lot of subsequent optimizations to be made.

Tags: Directory compilation necessary parameter password data file method user preparation production configuration security binary database faster version environment program level Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MySQL OPPO Reno Apple NVidia