Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to the methods of how to install, deploy, initialize and create instances in mysql5.7

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to install and deploy, initialize and create instances of mysql5.7. The content of the article is carefully selected and edited by the author, which is targeted and of great significance to everyone's reference. Let's learn how to install and deploy, initialize and create instances of mysql5.7 with the author.

A very simple process.

Environmental Information:

Centos 7.2

Mysql 5.7.21

1. Download the extracted mysql package

Cd / usr/local/wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.21-linux-glibc2.12-x86_64.tar.gztar xzvf mysql-5.7.21-linux-glibc2.12-x86_64.tar.gzmv mysql-5.7.21-linux-glibc2.12-x86_64 mysql

two。 Initialize mysql basic environment information

Vim / etc/profilePATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATHexport PATHexport MYSQL_HOME= "/ usr/local/mysql" export ms= "/ usr/local/mysql"

3. Initialize configuration instance profile

Mkdir-p / usr/local/mysql/data/mcdbvi / usr/local/mysql/data/ my.cnf [client] port = 3310socket = / usr/local/mysql/data/mcdb/ mysql.sock [MySQL] no-auto- rehash [mysqld] user = mysqlport = / usr/local/mysql/data/mcdb/mysql.sockbasedir = / usr/local/mysqldatadir = / usr/local/mysql/datapid-file = / usr/local/mysql/data/mcdb/mysql.pidrelay-log = / usr/local/mysql/ Data/mcdb/relay-binrelay-log-info-file = / usr/local/mysql/data/mcdb/relay-log.infoserver-id = 12 [mysqld_safe] log-error = / usr/local/mysql/data/mcdb/mysql.errpid-file = / usr/local/mysql/data/mcdb/mysql.pid

4. New user

Groupadd mysqluseradd mysql-g mysqlchown mysql:mysql / usr/local/mysql-R

5. Initialize mysql instance

Mysqld-initialize-basedir=/usr/local/mysql-datadir=/usr/local/mysql/data/mcdb-user=mysql

Get the password from the last line of the return message, take a chestnut:

YUlta1lw*uwF

6. Move the configuration file to the instance directory and start the instance mysql

Mv / usr/local/mysql/data/my.cnf / usr/local/mysql/data/mcdb/my.cnfmysqld_safe-defaults-file=/usr/local/mysql/data/mcdb/my.cnf-user=mysql-basedir=/usr/local/mysql-datadir=/usr/local/mysql/data/mcdb &

7. Log in to mysql

Mysql-uroot-pyUlta1lw*uwF-S / usr/local/mysql/data/mcdb/mysql.sock

8. Set password

Mysql > SET PASSWORD = PASSWORD ('hello2018'); mysql > flush privileges

9. Create a user and open remote login permissions

Grant all privileges on *. * to 'bodie'@'%' identified by' happybirthday' with grant option

After reading the above about how to install, deploy, initialize and create instances of mysql5.7, many readers must have some understanding. If you need more industry knowledge and information, you can continue to follow our industry information section.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report