Home  >  Article  >  Database  >  Detailed introduction to CentOS installation of mysql5.7 and simple configuration

Detailed introduction to CentOS installation of mysql5.7 and simple configuration

黄舟
黄舟Original
2017-03-24 14:15:171588browse

This article mainly introduces the installation of mysql5.7 on CentOS and the detailed explanation of the simple configuration tutorial. It is very good and has reference value. Friends in need can refer to it

Installation

Make sure your user has permission to install

without switching root

su root

(su means: swich user)

# rpm -ivh

may encounter

warning: /var/tmp/rpm-tmp.6V5aFC: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

which can be ignored (personal opinion, Baidu Didn't find a suitable answer at once)

# yum install mysql-community-server

Waiting for the installation to complete....

Configuration

##Find the initial password after installation here:

grep 'temporary password' ar/log/mysqld.log

mysql 5.7 has requirements for password complexity. If you want to create a simple password, you can first execute

set global validate_password_policy=0;

and then create a user


Be careful to turn off SELinux for newly installed servers, otherwise you may encounter problems caused by many permissions

setenforce 0
vi/etc/selinux/config

Change ENFORCE=enforcing to ENFORCE=disable


Configuration file

Linux: /etc/my.cnf

Windows: my.ini in the installation directory

Default character set


Versions before 5.6

[mysqld]
default-character-set=utf8

Versions after 5.6

[mysqld]
character-set-server=utf8

Modify the character set of the existing database

alter database mydb default character set utf8;

Table names are not case-sensitive

[mysqld]
lower_case_table_names=1

Allow creation in log-bin mode

Function

[mysqld]
log_bin_trust_function_creators=true

Enable strict mode. If the field is too long in non-strict mode, it will be automatically truncated

[mysqld]
sql-mode="STRICT_TRANS_TABLES"

The above is the detailed content of Detailed introduction to CentOS installation of mysql5.7 and simple configuration. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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