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

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

黄舟
Release: 2017-03-24 14:15:17
Original
1630 people have browsed it

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
Copy after login

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

# yum install mysql-community-server
Copy after login

Waiting for the installation to complete....

Configuration

##Find the initial password after installation here:

grep 'temporary password' ar/log/mysqld.log
Copy after login

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;
Copy after login

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
Copy after login

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
Copy after login

Versions after 5.6

[mysqld]
character-set-server=utf8
Copy after login

Modify the character set of the existing database

alter database mydb default character set utf8;
Copy after login

Table names are not case-sensitive

[mysqld]
lower_case_table_names=1
Copy after login

Allow creation in log-bin mode

Function

[mysqld]
log_bin_trust_function_creators=true
Copy after login

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

[mysqld]
sql-mode="STRICT_TRANS_TABLES"
Copy after login

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!

Related labels:
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