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

Deploy, initialize mysql8.0, and create instance resolution

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article is mainly about deployment, initialization of mysql8.0 and creation of instance resolution. You can check the relevant professional terms on the Internet or find some related books to supplement them. We will not dabble here. Let's go straight to the topics of deployment, initialization of mysql8.0 and creation of instance resolution. I hope we can bring some practical help to you.

Environmental Information:

Centos 7.4.1708

Mysql 8.0.11

1. Download the extracted mysql package

Cd / opt/wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.11-linux-glibc2.12-x86_64.tar.gztar xzvf mysql-8.0.11-linux-glibc2.12-x86_64.tar.gzmv mysql-8.0.11-linux-glibc2.12-x86_64 mysql

two。 Initialize mysql basic environment information

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

3. Initialize configuration instance profile

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

4. New user

Groupadd mysqluseradd mysql-g mysqlchown mysql:mysql / opt/mysql-R

5. Initialize mysql instance

/ opt/mysql/bin/mysqld-initialize-basedir=/opt/mysql-datadir=/opt/mysql/data/mcdb-user=mysql

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

XHGkgc+9ea6/

6. Start the instance mysql

Mv / opt/mysql/data/my.cnf / opt/mysql/data/mcdb/my.cnf/opt/mysql/bin/mysqld_safe-defaults-file=/opt/mysql/data/mcdb/my.cnf-user=mysql-basedir=/opt/mysql-datadir=/opt/mysql/data/mcdb 2 > & 1 > / dev/null &

7. Log in to mysql

/ opt/mysql/bin/mysql-uroot-pxHGkgc+9ea6/-S / opt/mysql/data/mcdb/mysql.sock

8. Set a new password

Set password = 'hello2018'

Let's stop here. If you want to know about other related issues, you can continue to pay attention to our industry information. Our section will capture some industry news and professional knowledge to share with you every day.

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