Home > Database > Mysql Tutorial > body text

MySQL5.7.18 binary package installation tutorial under Linux

巴扎黑
Release: 2018-05-26 14:10:51
Original
2203 people have browsed it

This article mainly introduces the installation tutorial of MySQL5.7.18 binary package under Linux (no default configuration file my_default.cnf). Friends in need can refer to it

The latest is learning MySQL, a pure novice, and familiar with Linux I don’t know much about it, because I downloaded the latest version of MySQL (MySQL5.7.18) binary package and tested the installation under CentOS7.2 to facilitate future troubles.

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

It’s not as complicated as you might imagine. Most of the steps are from the Internet. Just follow them. If you make a mistake, 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

Unzip the MySQL binary package

## as follows It is the file information after decompression and renaming the folder

##Change the group and user to which it belongs

The contents of the decompressed MySQL file

Check the contents of the support-files

folder and find that there is no

my_default.cnfdefault configuration file. If there is no default configuration file, you need to create one manuallymy_default.cnfConfiguration file

I found a configuration file from the Internet, as follows, and uploaded it to the supp-files folder. Of course, this configuration file can be based on You need to modify it yourself

# 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 install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
# 一般配置选项
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
Copy after login

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

Register and initialize the MySQL service

This is a bit confusing. Most of the tutorials on the Internet use the mysql_install_db method to install. This step is also the most problematic. I have been struggling for a long time, but the mysql_install_db command is not recommended. It also prompts to use mysqld to install it.

Various errors were reported when installing mysql 5.7.18. After various attempts, install it using the following naming method. 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 after login

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

Start the MySQL service

Connect to MySQL, there is no password by default, directly Enter and connect to MySQL

##Change the root password of MySQL

Modification can be accessed remotely

Restart the MySQL service

At this time, MySQL can be used normally locally

Test remote connection

The above is the detailed content of MySQL5.7.18 binary package installation tutorial under Linux. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template