How to install and configure mysql 5.7.19 under centos6.5

How to install and configure mysql 5.7.19 under centos6.5

The detailed steps for installing mysql5.7.19 on centos6.5 are as follows

1. Download mysql5.7.19 from the oracle website
2. Add centos user group and user MySQL

groupadd mysql
useradd mysql -g mysql

3. Unzip the files to be installed to the specified directory.

You need to set the chown 755 directory to allow mysql to access it.

4. Find bin in the unzipped mysql directory, where there is the mysqld executable file. implement

./mysqld --user=mysql --basedir=/home/mysql/mysql-5.7.16-linux-glibc2.5-x86_64 --datadir=/home/mysql/data --initialize

5. Copy my-defalut.cnf in the support-files directory under the installation directory to /etc/my.cnf

6. Copy mysql.service in the support-files directory under the installation directory to /etc/init.d/mysqld

7. Set up the mysql connection and connect the mysql in the bin directory under the installation directory to /usr/local/bin
ln -fs /home/mysql/mysql-5.7.16-linux-glibc2.5-x86_64/bin/mysql /usr/local/bin/mysql

8. Modify /etc/my.cnf

set up
basedir=/home/mysql
datadir=/home/mysql/data
user=mysql

9. service mysql start starts mysql

10. mysql -uroot connects to mysql and prompts root@localhost login is not allowed , you need to set a password

Shut down mysql first

Modify /etc/my.cnf

Add skip-grant-tables to mysqld

Enable mysql

Enter

mysql>UPDATE mysql.user SET authentication_string=password('123456') WHERE User='root' AND Host='localhost';

Just change the root password.

Or enter mysql> set password=password('123456');

11. Set the character type of the database

Edit /etc/my.cnf
Add in mysqld
character-set-server=utf8
Add in client
default-character-set=utf8

12. Check the character type of the database

mysql>show variables like "%character%";

Wonderful topic sharing: Installation tutorials for different versions of MySQL Installation tutorials for MySQL 5.7 versions Installation tutorials for MySQL 5.6 versions

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • mysql5.7.19 winx64 decompressed version installation and configuration tutorial
  • MySQL 5.7.19 installation and configuration method graphic tutorial (win10)
  • mysql5.7.19 winx64 installation and configuration method graphic tutorial (win10)
  • Summary of Problems in Installation and Usage of MySQL 5.7.19 Winx64 ZIP Archive
  • MySQL 5.7.19 (tar.gz) installation graphic tutorial under Linux
  • How to create a my.ini file in the MySQL 5.7.19 installation directory
  • Detailed tutorial on configuration method of Mysql 5.7.19 free installation version (64-bit)
  • How to install multiple mysql5.7.19 (tar.gz) files under Linux
  • The latest version of MySQL5.7.19 decompression version installation guide
  • MySQL 5.7.19 installation tutorial under Windows 10 How to change the root password of MySQL after forgetting it

<<:  Ideas and codes for implementing waterfall flow layout in uniapp applet

>>:  How to deploy nodejs service using Dockerfile

Recommend

How to create your own image using Dockerfile

1. Create an empty directory $ cd /home/xm6f/dev ...

MySQL daily statistics report fills in 0 if there is no data on that day

1. Problem reproduction: Count the total number o...

SMS verification code login function based on antd pro (process analysis)

Table of contents summary Overall process front e...

Detailed explanation of how to introduce custom fonts (font-face) in CSS

Why did I use this? It all started with the makin...

How to safely shut down MySQL

When shutting down the MySQL server, various prob...

202 Free High Quality XHTML Templates (2)

Following the previous article 202 Free High-Qual...

MySQL fuzzy query usage (regular, wildcard, built-in function)

Table of contents 1. MySQL wildcard fuzzy query (...

Vue uses v-model to encapsulate the entire process of el-pagination components

Use v-model to bind the paging information object...

MySQL Community Server 5.7.19 Installation Guide (Detailed)

MySQL official website zip file download link htt...

Some details about semicolons in JavaScript

Preface Semicolons in JavaScript are optional, an...

How to implement multiple parameters in el-dropdown in ElementUI

Recently, due to the increase in buttons in the b...

Introduction to root directory expansion under Linux system

1. Check Linux disk status df -lh The lsblk comma...