MySQL 5.7.18 binary package installation tutorial under Linux (without default configuration file my_default.cnf)

MySQL 5.7.18 binary package installation tutorial under Linux (without default configuration file my_default.cnf)

I am currently learning MySQL. I am a complete novice and don’t know much about Linux. I downloaded the latest version of MySQL (MySQL5.7.18) binary package and tested and installed it under CentOS7.2 to facilitate future work.

The approximate steps are as follows. After installing and deleting the files several times, there should be no problem if you follow the steps below.

It is not as complicated as you might think. Most of the steps are based on references from the Internet. Just follow them. If you make mistakes, try more and check more information.

Operating system version

Create mysql group and user

Download the latest version of MySQL 5.7.18 binary package and upload it to the usr/local directory of the server

Unpack the MySQL binary package

The following is the file information after decompression and renaming the folder

Change the group and user

The contents of the decompressed MySQL file

Check the contents of the support-files folder and find that there is no default configuration file my_default.cnf . If there is no default configuration file, you need to manually create a my_default.cnf configuration file.

I found a configuration file on the Internet, as follows, and uploaded it to the supp-files folder. Of course, this configuration file can be modified as needed.

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during installation, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
# General configuration options basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
port = 3306
socket = /var/run/mysqld/mysqld.sock
character-set-server=utf8
back_log = 300
max_connections = 3000
max_connect_errors = 50
table_open_cache = 4096
max_allowed_packet = 32M
#binlog_cache_size = 4M
max_heap_table_size = 128M
read_rnd_buffer_size = 16M
sort_buffer_size = 16M
join_buffer_size = 16M
thread_cache_size = 16
query_cache_size = 128M
query_cache_limit = 4M
ft_min_word_len = 8
thread_stack = 512K
transaction_isolation = REPEATABLE-READ
tmp_table_size = 128M
#log-bin=mysql-bin
long_query_time = 6
server_id=1
innodb_buffer_pool_size = 1G
innodb_thread_concurrency = 16
innodb_log_buffer_size = 16M
innodb_log_file_size = 512M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
innodb_file_per_table = on
[mysqldump]
quick
max_allowed_packet = 32M
[mysql]
no-auto-rehash
default-character-set=utf8
safe-updates
[myisamchk]
key_buffer = 16M
sort_buffer_size = 16M
read_buffer = 8M
write_buffer = 8M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
open-files-limit = 8192
[client]
/bin/bash: Q: command not found

Upload the above default configuration file to the support-files folder as follows

Register and initialize the MySQL service

This is a bit tricky. Most of the tutorials on the Internet are installed using the mysql_install_db method. This step is also the most problematic. I struggled for a long time, but the mysql_install_db command is not recommended. It also prompts to use mysqld to install.

When installing MySQL 5.7.18, there are also various errors. After various attempts, use the following naming method to install. As long as there is no Error, ignore the warning message Warning

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

Copy the above my_default.cnf and mysql.server configuration files to the etc directory. The files have been copied to the etc directory before. It prompts whether to overwrite. Enter Y to overwrite.

Start MySQL Service

Connect to MySQL. There is no password by default. Press Enter to connect to MySQL.

Change MySQL root password

Modify remote access

Restart MySQL service

At this point, you can use MySQL normally locally

Testing Remote Connection

You may also be interested in:
  • Deploy MySQL 5.7.17 binary installation and multi-instance configuration on CentOS 6.5
  • Detailed tutorial on customizing the installation path of MySQL 5.7.18 version (binary package installation)
  • How to install mysql5.7.24 binary version on Centos 7 and how to solve it
  • Centos7.5 installs mysql5.7.24 binary package deployment
  • Detailed tutorial on installing MySQL 5.7.11 for Linux Generic binary version in CentOS 7 via command line
  • Tutorial on installing MySQL 5.6.20 using Linux binary universal package
  • Install mysql5.6 in ubuntu system (through binary)
  • mysql 5.7.19 latest binary installation
  • MySQL 5.6.24 (binary) automatic installation script under Linux
  • The whole process record of MySQL binary installation and backup

<<:  How to deploy nextcloud network disk using docker

>>:  Summary of various ways to create objects in js and their advantages and disadvantages

Recommend

Detailed tutorial on installing nvidia driver + CUDA + cuDNN in Ubuntu 16.04

Preparation 1. Check whether the GPU supports CUD...

A brief discussion on spaces and blank lines in HTML code

All consecutive spaces or blank lines (newlines) ...

How to use resident nodes for layer management in CocosCreator

CocosCreator version: 2.3.4 Most games have layer...

Optimization methods when Mysql occupies too high CPU (must read)

When Mysql occupies too much CPU, where should we...

Nginx Location directive URI matching rules detailed summary

1. Introduction The location instruction is the c...

Teach you how to use webpack to package and compile TypeScript code

TypeScript Bundling webpack integration Usually, ...

How to avoid duplication of data when inserting in MySql batch

Table of contents Preface 1. insert ignore into 2...

Introduction to building a DNS server under centos7

Table of contents 1. Project environment: 2: DNS ...

Several methods to solve the problem of MySQL fuzzy query index failure

When we use the like % wildcard, we often encount...

HTML small tag usage tips

Phrase elements such as <em></em> can ...

CSS+HTML to realize the top navigation bar function

Implementation of navigation bar, fixed top navig...

Methods for optimizing Oracle database with large memory pages in Linux

Preface PC Server has developed to this day and h...

How to redirect PC address to mobile address in Vue

Requirements: The PC side and the mobile side are...

10 reasons why Linux is becoming more and more popular

Linux has been loved by more and more users. Why ...