最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Linux7.6二進(jìn)制安裝Mysql8.0.27詳細(xì)操作步驟

 更新時間:2021年11月26日 10:40:44   作者:IT邦德  
大家好,本篇文章主要講的是Linux7.6二進(jìn)制安裝Mysql8.0.27詳細(xì)操作步驟,感興趣的同學(xué)快來看一看吧,希望對你起到幫助

一、環(huán)境準(zhǔn)備

1.1 操作系統(tǒng)版本

[root@rhel76 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)

1.2 磁盤空間

[root@rhel76 ~]# df -TH
Filesystem            Type      Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root xfs        32G  4.6G   27G  15% /
devtmpfs              devtmpfs  2.1G     0  2.1G   0% /dev
tmpfs                 tmpfs     2.1G     0  2.1G   0% /dev/shm
tmpfs                 tmpfs     2.1G   14M  2.1G   1% /run
tmpfs                 tmpfs     2.1G     0  2.1G   0% /sys/fs/cgroup
/dev/sda1             xfs       996M  172M  825M  18% /boot
/dev/mapper/rhel-u01  xfs        30G   34M   30G   1% /u01
tmpfs                 tmpfs     413M  4.1k  413M   1% /run/user/42
tmpfs                 tmpfs     413M   46k  413M   1% /run/user/0

1.3 關(guān)閉防火墻

[root@rhel76 ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2021-11-23 23:46:04 UTC; 9min ago
     Docs: man:firewalld(1)
Main PID: 9621 (firewalld)
    Tasks: 2
   CGroup: /system.slice/firewalld.service
           └─9621 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid


Nov 23 23:46:03 rhel76 systemd[1]: Starting firewalld - dynamic firewall daemon...
Nov 23 23:46:04 rhel76 systemd[1]: Started firewalld - dynamic firewall daemon.

[root@rhel76 ~]# systemctl stop firewalld
[root@rhel76 ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

在這里插入圖片描述

1.4 關(guān)閉 selinux

[root@rhel76 ~]# getenforce
Enforcing

[root@rhel76 ~]# cp /etc/selinux/config /etc/selinux/config_`date +"%Y%m%d_%H%M%S"`
[root@rhel76 ~]# sed -i 's/SELINUX\=enforcing/SELINUX\=disabled/g' /etc/selinux/config

以上修改完后重啟
[root@rhel76 ~]# reboot

[root@rhel76 ~]# getenforce
Disabled
[root@rhel76 ~]# sestatus
SELinux status:  disabled

1.5 HOST解析

[root@rhel76 ~]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.6.81 rhel76

[root@rhel76 ~]# hostname
rhel76

在這里插入圖片描述

1.6 Mysql下載

https://dev.mysql.com/downloads/mysql/
MD5: 0bdd171cb8464ba32f65f7bf58bc9533

在這里插入圖片描述

二、 yum安裝及配置

2.1 掛載本地光盤鏡像

[root@rhel76 ~]# mkdir -p /mnt/dvd/

[root@rhel76 ~]# df -TH
Filesystem            Type      Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root xfs        32G  4.7G   27G  15% /
devtmpfs              devtmpfs  2.1G     0  2.1G   0% /dev
tmpfs                 tmpfs     2.1G     0  2.1G   0% /dev/shm
tmpfs                 tmpfs     2.1G   14M  2.1G   1% /run
tmpfs                 tmpfs     2.1G     0  2.1G   0% /sys/fs/cgroup
/dev/sda1             xfs       996M  172M  825M  18% /boot
/dev/mapper/rhel-u01  xfs        30G   34M   30G   1% /u01
tmpfs                 tmpfs     413M   21k  413M   1% /run/user/0
tmpfs                 tmpfs     413M   13k  413M   1% /run/user/42
/dev/sr0              iso9660   4.5G  4.5G     0 100% /run/media/root/RHEL-7.6 Server.x86_64

[root@rhel76 ~]# mount /dev/sr0 /mnt/dvd
mount: /dev/sr0 is write-protected, mounting read-only
You have mail in /var/spool/mail/root

在這里插入圖片描述

2.2 配置yum源

[root@rhel76 ~]# cd /etc/yum.repos.d/
[root@rhel76 yum.repos.d]# cat >> /etc/yum.repos.d/redhat.repo << "EOF"
> [rhel7]
> name=jeames repo
> baseurl=file:///mnt/dvd/
> gpgcheck=0
> EOF

2.3 安裝依賴包

[root@rhel76 ~]# yum -y groupinstall "DeveLopment tools"
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
Warning: Group development does not have any packages to install.
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update

[root@rhel76 ~]# yum -y install ncurses ncurses-devel openssl-devel bison gcc gcc-c++ make

在這里插入圖片描述

三、卸載MariaDB

[root@rhel76 ~]# rpm -qa |grep mariadb
mariadb-libs-5.5.60-1.el7_5.x86_64

[root@rhel76 ~]# rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64

四、安裝 MySQL

4.1 用戶及目錄創(chuàng)建

注:可以部署多個實(shí)例,通過端口區(qū)分root 用戶操作:mkdir -p /mysql/data/mysql3306mkdir -p /mysql/app/mkdir -p /mysql/conf/mkdir -p /mysql/data/mysql3306/pid/mkdir -p /mysql/data/mysql3306/socket/mkdir -p /mysql/data/mysql3306/log/mkdir -p /mysql/data/mysql3306/binlog/mkdir -p /mysql/data/mysql3306/errlogmkdir -p /mysql/data/mysql3306/relaylog/mkdir -p /mysql/data/mysql3306/slowlog/mkdir -p /mysql/data/mysql3306/tmp/

4.2 用戶及組

[root@rhel76 ~]# groupadd mysql
[root@rhel76 ~]# useradd -g mysql mysql
[root@rhel76 ~]# chown -R mysql:mysql /mysql
[root@rhel76 ~]# passwd mysql
Changing password for user mysql.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.

[root@rhel76 ~]# cat /etc/group | grep mysql
mysql:x:1001:
[root@rhel76 ~]# cat /etc/passwd | grep mysql
mysql:x:1001:1001::/home/mysql:/bin/bash

在這里插入圖片描述

4.3 上傳軟件包并解壓

[root@rhel76 ~]# cp mysql-8.0.27-linux-glibc2.12-x86_64.tar.xz /mysql/app
[root@rhel76 ~]# chown -R mysql:mysql /mysql

mysql用戶操作
[root@rhel76 ~]# su - mysql
md5 值驗(yàn)證,保證下載到的軟件包無破損無木馬
[mysql@rhel76 ~]$ cd /mysql/app
[mysql@rhel76 app]$ ll
total 1168588
-rw-r--r-- 1 mysql mysql 1196633756 Nov 24 00:49 mysql-8.0.27-linux-glibc2.12-x86_64.tar.xz
[mysql@rhel76 app]$ md5sum mysql-8.0.27-linux-glibc2.12-x86_64.tar.xz
0bdd171cb8464ba32f65f7bf58bc9533  mysql-8.0.27-linux-glibc2.12-x86_64.tar.xz

解壓軟件包并重命名
[mysql@rhel76 app]$ tar xvf mysql-8.0.27-linux-glibc2.12-x86_64.tar.xz
[mysql@rhel76 app]$ mv mysql-8.0.27-linux-glibc2.12-x86_64 mysql8.0.27

[mysql@rhel76 app]$ ll
total 1168588
drwxrwxr-x 9 mysql mysql        129 Nov 24 00:54 mysql8.0.27
-rw-r--r-- 1 mysql mysql 1196633756 Nov 24 00:49 mysql-8.0.27-linux-glibc2.12-x86_64.tar.xz

在這里插入圖片描述

五.環(huán)境變量配置

cat >> /home/mysql/.bash_profile << "EOF"
MYSQL_HOME=/mysql/app/mysql8.0.27
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$MYSQL_HOME/bin
EOF


source ~/.bash_profile
which mysql

在這里插入圖片描述

六.創(chuàng)建參數(shù)文件

由于是二進(jìn)制文件安裝,數(shù)據(jù)庫參數(shù)文件需要自己配置

cat >> /mysql/conf/my3306.cnf << "EOF"
[mysqld]
server_id = 80273306
default-storage-engine= InnoDB
basedir=/mysql/app/mysql8.0.27
datadir=/mysql/data/mysql3306/data/
socket=/mysql/data/mysql3306/socket/mysql.sock
log-error=/mysql/data/mysql3306/log/mysqld.log
pid-file=/mysql/data/mysql3306/pid/mysqld.pid
port=3306
default-time_zone='+8:00'
default_authentication_plugin=mysql_native_password # 加此參數(shù)可遠(yuǎn)程登陸
transaction_isolation=READ-COMMITTED
max_connections=1500
back_log=500
wait_timeout=1800
max_user_connections=800
innodb_buffer_pool_size=1024M
innodb_log_file_size=512M
innodb_log_buffer_size=40M
slow_query_log=ON
long_query_time=5
# log settings #
slow_query_log = ON
slow_query_log_file = /mysql/data/mysql3306/slowlog/slow3306.log
log_error = /mysql/data/mysql3306/errlog/err3306.log
log_error_verbosity = 3
log_bin = /mysql/data/mysql3306/binlog/mysql_bin
log_bin_index = /mysql/data/mysql3306/binlog/mysql_binlog.index
general_log_file = /data/mysql/mysql3306/generallog/general.log
log_queries_not_using_indexes = 1
log_slow_admin_statements = 1
expire_logs_days = 90
binlog_expire_logs_seconds = 2592000      #30d
long_query_time = 2
min_examined_row_limit = 100
log_throttle_queries_not_using_indexes = 1000
innodb_flush_log_at_trx_commit=1

EOF

七.數(shù)據(jù)庫初始化

mysql用戶操作:
mysqld --defaults-file=/mysql/conf/my3306.cnf --initialize --user=mysql --basedir=/mysql/app/mysql8.0.27 --datadir=/mysql/data/mysql3306/data/
注意:以上同一行執(zhí)行

八.啟動Mysql

[mysql@rhel76 ~]$ mysqld_safe --defaults-file=/mysql/conf/my3306.cnf --user=mysql &
[1] 21406
[mysql@rhel76 ~]$ 2021-11-24T06:14:23.240372Z mysqld_safe Logging to '/mysql/data/mysql3306/errlog/err3306.log'.
2021-11-24T06:14:23.296992Z mysqld_safe Starting mysqld daemon with databases from /mysql/data/mysql3306/data

在這里插入圖片描述

九.登陸Mysql

第一次登錄 MySQL 時,需要到錯誤日志下找初始化密碼,我這里的密碼為:-(Qy5Aj9t,=a
使用 socket 加密碼登錄進(jìn)去后,無法查詢?nèi)魏螙|西,提示先要修改 root 密碼。

[mysql@rhel76 ~]$ cat /mysql/data/mysql3306/errlog/err3306.log | grep password

2021-11-24T06:12:14.610657Z 0 [Note] [MY-010309] [Server] Auto generated RSA key files through --sha256_password_auto_generate_rsa_keys are placed in data directory.
2021-11-24T06:12:14.610686Z 0 [Note] [MY-010308] [Server] Skipping generation of RSA key pair through --caching_sha2_password_auto_generate_rsa_keys as key files are present in data directory.
2021-11-24T06:12:14.615367Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: -(Qy5Aj9t,=a
2021-11-24T06:14:26.153958Z 0 [Note] [MY-010308] [Server] Skipping generation of RSA key pair through --sha256_password_auto_generate_rsa_keys as key files are present in data directory.
2021-11-24T06:14:26.153979Z 0 [Note] [MY-010308] [Server] Skipping generation of RSA key pair through --caching_sha2_password_auto_generate_rsa_keys as key files are present in data directory.

[mysql@rhel76 ~]$ mysql -uroot -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

##此處通過sock登陸
[mysql@rhel76 ~]$ mysql -uroot -p  -P 3306 -S /mysql/data/mysql3306/socket/mysql.sock
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.27


Copyright (c) 2000, 2021, Oracle and/or its affiliates.


Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> status
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

十.修改密碼

mysql> alter user root@'localhost' identified by 'root';Query OK, 0 rows affected (0.01 sec)mysql> status--------------mysql  Ver 8.0.27 for Linux on x86_64 (MySQL Community Server - GPL)Connection id:          8Current database:Current user:           root@localhostSSL:                    Not in useCurrent pager:          stdoutUsing outfile:          ''Using delimiter:        ;Server version:         8.0.27Protocol version:       10Connection:             Localhost via UNIX socketServer characterset:    utf8mb4Db     characterset:    utf8mb4Client characterset:    utf8mb4Conn.  characterset:    utf8mb4UNIX socket:            /mysql/data/mysql3306/socket/mysql.sockBinary data as:         HexadecimalUptime:                 8 min 0 secThreads: 2  Questions: 7  Slow queries: 0  Opens: 398  Flush tables: 3  Open tables: 36  Queries per second avg: 0.014--------------

十一.遠(yuǎn)程登陸設(shè)置

使用如下語句創(chuàng)建 root 用戶是無法通過 navicat 等客戶端登錄的,
由于從 MySQL8 開始,身份驗(yàn)證插件發(fā)生改變,
默認(rèn)的 “caching_sha2_password” 不允許遠(yuǎn)程登錄,
故需將此插件修改為 “mysql_native_password” 便可登錄。

mysql> create user root@'%' identified with mysql_native_password by 'root';
mysql> grant all on *.* to root@'%' with grant option;
mysql> flush privileges;

mysql> select user,host,plugin from mysql.user;  
+------------------+-----------+-----------------------+
| user             | host      | plugin                |
+------------------+-----------+-----------------------+
| root             | %         | mysql_native_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session    | localhost | caching_sha2_password |
| mysql.sys        | localhost | caching_sha2_password |
| root             | localhost | mysql_native_password |
+------------------+-----------+-----------------------+
5 rows in set (0.00 sec)

在這里插入圖片描述

到此這篇關(guān)于Linux7.6二進(jìn)制安裝Mysql8.0.27詳細(xì)操作步驟的文章就介紹到這了,更多相關(guān)Linux7.6二進(jìn)制安裝Mysql8.0.27內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • MySQL中配置文件my.cnf因權(quán)限問題導(dǎo)致無法啟動的解決方法

    MySQL中配置文件my.cnf因權(quán)限問題導(dǎo)致無法啟動的解決方法

    這篇文章主要給大家介紹了關(guān)于MySQL中配置文件my.cnf因權(quán)限問題導(dǎo)致無法啟動的解決方法,該無法啟動的錯誤提示代碼是:World-writable config file '/etc/my.cnf' is ignored,文中給出了詳細(xì)的解決方法,需要的朋友們下面來一起看看吧。
    2017-06-06
  • mysql8.0忘記密碼的詳細(xì)解決方法

    mysql8.0忘記密碼的詳細(xì)解決方法

    很早前安裝了MYSQL,現(xiàn)在由于需要使用MYSQL但忘記密碼,所以下面這篇文章主要給大家介紹了關(guān)于mysql8.0忘記密碼的詳細(xì)解決方法,文中通過圖文介紹的非常詳細(xì),需要的朋友可以參考下
    2022-06-06
  • MySQL索引失效場景及解決方案

    MySQL索引失效場景及解決方案

    這篇文章主要介紹了MySQL索引失效場景及解決方案,文章圍繞主題展開詳細(xì)的內(nèi)容介紹,具有一定的參考價值,需要的朋友可以參考一下
    2022-07-07
  • mysql啟動錯誤之mysql啟動報1067錯誤解決方法

    mysql啟動錯誤之mysql啟動報1067錯誤解決方法

    MYSQL啟動報1067錯誤,系統(tǒng)日志中是“服務(wù) mysql 意外停止” Mysql日志中則是:Plugin 'FEDERATED' is disabled,下面給出解決方法
    2014-02-02
  • MySQL group by和left join并用解決方式

    MySQL group by和left join并用解決方式

    這篇文章主要介紹了MySQL group by和left join并用解決方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2023-12-12
  • MySQL中數(shù)據(jù)查詢語句整理大全

    MySQL中數(shù)據(jù)查詢語句整理大全

    查詢語句是以后在工作中使用最多也是最復(fù)雜的用法,如何精準(zhǔn)的查詢出想要的結(jié)果以及用最合理的邏輯去查詢尤為重要,下面這篇文章主要給大家介紹了關(guān)于MySQL中數(shù)據(jù)查詢語句的相關(guān)資料,需要的朋友可以參考下
    2023-04-04
  • MySQL時間戳與日期格式的相互轉(zhuǎn)換

    MySQL時間戳與日期格式的相互轉(zhuǎn)換

    在MySQL數(shù)據(jù)庫中,時間戳和日期格式是常用的數(shù)據(jù)類型,在MySQL中,我們可以使用函數(shù)還相互轉(zhuǎn)換時間戳和日期格式,下面我將詳細(xì)的給大家介紹如何進(jìn)行轉(zhuǎn)換,并提供相應(yīng)的代碼示例,感興趣的小伙伴跟著小編一起來看看吧
    2024-01-01
  • MYSQL存儲過程 注釋詳解

    MYSQL存儲過程 注釋詳解

    這篇文章主要介紹MYSQL存儲的過程,本文圍繞MYSQL存儲詳細(xì)展開文章內(nèi)容,并附上詳細(xì)代碼解析,需要的下伙伴可以參考一下,希望對你有所幫助
    2021-10-10
  • SQL中如何將行轉(zhuǎn)成列詳解

    SQL中如何將行轉(zhuǎn)成列詳解

    行列轉(zhuǎn)換在做報表分析時還是經(jīng)常會遇到的,今天就說一下如何實(shí)現(xiàn)行列轉(zhuǎn)換吧,下面這篇文章主要給大家介紹了關(guān)于SQL中如何將行轉(zhuǎn)成列的相關(guān)資料,需要的朋友可以參考下
    2022-11-11
  • 使用SQL語句統(tǒng)計數(shù)據(jù)時sum和count函數(shù)中使用if判斷條件的講解

    使用SQL語句統(tǒng)計數(shù)據(jù)時sum和count函數(shù)中使用if判斷條件的講解

    今天小編就為大家分享一篇關(guān)于使用SQL語句統(tǒng)計數(shù)據(jù)時sum和count函數(shù)中使用if判斷條件的講解,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧
    2019-02-02

最新評論

称多县| 敦煌市| 泰顺县| 中西区| 屏东县| 民勤县| 西畴县| 浦县| 镇平县| 芦溪县| 江口县| 澄迈县| 台北县| 阿克| 集贤县| 清流县| 蕉岭县| 临泽县| 军事| 郯城县| 吉首市| 金塔县| 阿拉善右旗| 湖北省| 韶关市| 无棣县| 阳原县| 石阡县| 左贡县| 闸北区| 泾源县| 江油市| 铜川市| 卓资县| 桐柏县| 辉县市| 连州市| 麻栗坡县| 南平市| 南郑县| 旬阳县|