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

mysql 5.7.18 winx64 free installation configuration method

1. Download 2. Decompression 3. Add the path envi...

Detailed explanation of application scenarios of filters in Vue

filter is generally used to filter certain values...

Implementation of Vue counter

Table of contents 1. Implementation of counter 2....

Solve the problem of resetting the Mysql root user account password

Problem description: The following error message ...

Implementation of textarea adaptive height solution in Vue

Table of contents Hidden Problems Solution to ada...

Element uses scripts to automatically build new components

Table of contents background How does element-ui&...

A brief discussion on React native APP updates

Table of contents App Update Process Rough flow c...

Detailed installation process of Jenkins on Linux

Table of contents 1. Install JDK 2. Install Jenki...

How to recover accidentally deleted messages files in Linux

If there are files that are being used by a proce...

How to make full use of multi-core CPU in node.js

Table of contents Overview How to make full use o...

Nginx rush purchase current limiting configuration implementation analysis

Due to business needs, there are often rush purch...

Implementation of sharing data between Docker Volume containers

What is volume? Volume means capacity in English,...

Let’s talk in detail about how browsers view closures

Table of contents Preface Introduction to Closure...

Bootstrap 3.0 study notes CSS related supplement

The main contents of this article are as follows:...