我的编程空间,编程开发者的网络收藏夹
学习永远不晚

mysql8安装记录

短信预约 -IT技能 免费直播动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

mysql8安装记录

运行环境:centos6.6+mysql8.0.12

1.下载官方打包好的二进制安装包:

#wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.12-linux-glibc2.12-x86_64.tar.xz
可以看到这个版本采用了tar.xz的打包压缩方式,文件只有350M左右,下载还是满方便的。
du -sh mysql-8.0.12-linux-glibc2.12-x86_64.tar.xz
339M mysql-8.0.12-linux-glibc2.12-x86_64.tar.xz

2.解压文件:

#tar -xJvf mysql-8.0.12-linux-glibc2.12-x86_64.tar.xz -C /usr/local/
mv /usr/local/mysql-8.0.12-linux-glibc2.12-x86_64/ /usr/local/mysql

3.配置参数文件:

cat /etc/my.cnf
[mysqld]
server-id = 1
port = 3306
mysqlx_port = 33060
mysqlx_socket = /tmp/mysqlx.sock
datadir = /data/mysql
socket = /tmp/mysql.sock
pid-file = /tmp/mysqld.pid
log-error = error.log
slow-query-log = 1
slow-query-log-file = slow.log
long_query_time = 0.2
log-bin = bin.log
relay-log = relay.log
binlog_format =ROW
relay_log_recovery = 1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
init_connect ='SET NAMES utf8mb4'
innodb_buffer_pool_size = 1G
join_buffer_size = 128M
sort_buffer_size = 2M
read_rnd_buffer_size = 2M
log_timestamps = SYSTEM
lower_case_table_names = 1
default-authentication-plugin =mysql_native_password

4.创建目录授权等:

groupadd mysql
useradd mysql
mkdir -p /data/mysql
chown -R mysql:mysql /data/mysql/
chmod -R 775 /data/mysql/

5.初始化数据库:

#/usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql --initialize-insecure
官方推荐使用--initialize,会在错误日志中生成难以输入的临时密码,我这里使用的免密码的方式。

cat /data/mysql/error.log | grep -i password
2018-07-29T02:06:41.253856+08:00 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: wquR3-Kxlg1d

6.设置启动文件和环境变量:

#cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql

--启动数据库:

/etc/init.d/mysql start
Starting MySQL.Logging to '/data/mysql/error.log'.
SUCCESS!

vim /etc/profile.d/mysql.sh
cat /etc/profile.d/mysql.sh
export PATH=$PATH:/usr/local/mysql/bin
source /etc/profile.d/mysql.sh
mysqld --version
mysqld Ver 8.0.12 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)
[root@node4 mysql]# /usr/local/mysql/bin/mysql -p -S /tmp/mysql.sock
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.12 MySQL Community Server - GPL
Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
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> select version();
+-----------+
| version() |
+-----------+
| 8.0.12 |
+-----------+
1 row in set (0.00 sec)

7.设置可以远程登录的账号:

mysql> show variables like '%valid%pass%';
Empty set (0.00 sec)
mysql> create user root@'%' identified by 'oracle';
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
mysql> show variables like '%valid%pass%';
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> alter user root@'localhost' identified by 'oracle';
Query OK, 0 rows affected (0.07 sec)
mysql> show variables like '%valid%pass%';
Empty set (0.01 sec)

--创建可以远程登录的用户:

mysql> create user root@'%' identified by 'oracle';
Query OK, 0 rows affected (0.06 sec)
mysql> grant all privileges on . to root@'%' with grant option;
Query OK, 0 rows affected (0.07 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

记录

解压
用量 930616
-rw-r--r--. 1 root root 50345454 6月 5 18:44 grafana-4.5.2-1.x86_64.rpm
-rw-r--r--. 1 root root 17067970 6月 5 18:41 influxdb-1.2.0.x86_64.rpm
-rw-r--r--. 1 root root 185646832 8月 24 22:57 jdk-8u181-linux-x64.tar.gz
-rw-r--r--. 1 root root 344964868 8月 1 19:44 mysql-8.0.12-linux-glibc2.12-i686.tar.xz
-rw-r--r--. 1 root root 354913940 8月 25 10:01 mysql-8.0.12-linux-glibc2.12-x86_64.tar.xz
[root@localhost home]#
[root@localhost home]# tar -xJvf mysql-8.0.12-linux-glibc2.12-x86_64.tar.xz -C /usr/local/

复制到
root@localhost home]# mv /usr/local/mysql-8.0.12-linux-glibc2.12-x86_64/ /usr/local/mysql
[root@localhost home]#
配置文件:
[root@localhost mysql]#
[root@localhost mysql]#
[root@localhost mysql]# cd /etc/
[root@localhost etc]# mv my.cnf my.cnf.bak
[root@localhost etc]# vim my.cnf
[mysqld]
server-id = 1
port = 3306
mysqlx_port = 33060
mysqlx_socket = /tmp/mysqlx.sock
datadir = /data/mysql
socket = /tmp/mysql.sock
pid-file = /tmp/mysqld.pid
log-error = error.log
slow-query-log = 1
slow-query-log-file = slow.log
long_query_time = 0.2
log-bin = bin.log
relay-log = relay.log
binlog_format =ROW
relay_log_recovery = 1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
init_connect ='SET NAMES utf8mb4'
innodb_buffer_pool_size = 1G
join_buffer_size = 128M
sort_buffer_size = 2M
read_rnd_buffer_size = 2M
log_timestamps = SYSTEM
lower_case_table_names = 1
default-authentication-plugin =mysql_native_password
~
"my.cnf" [新] 27L, 1083C 已写入
[root@localhost etc]#
[root@localhost etc]#
[root@localhost etc]#
[root@localhost etc]#
[root@localhost etc]# mkdir -p /data/mysql
[root@localhost etc]# chown -R mysql:mysql /data/mysql/
[root@localhost etc]# chmod -R 775 /data/mysql/
[root@localhost etc]#
/usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql --initialize-insecure
[root@localhost etc]# cat /data/mysql/error.log | grep -i password
2018-08-25T21:10:11.470522+08:00 5 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
~
"profile.d/mysql.sh" [新] 2L, 69C 已写入
[root@localhost etc]#
[root@localhost etc]# source /etc/profile.d/mysql.sh
[root@localhost etc]#
[root@localhost etc]# mysqld --version
mysqld Ver 8.0.12 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)
[root@localhost etc]# /usr/local/mysql/bin/mysql -p -S /tmp/mysql.sock
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.12 MySQL Community Server - GPL

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

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> select version();
+-----------+
| version() |
+-----------+
| 8.0.12 |
+-----------+
1 row in set (0.00 sec)

mysql> show variables like '%valid%pass%';
Empty set (0.02 sec)

mysql> show variables like '%valid%pass%';
Empty set (0.02 sec)

mysql> create user root@'%' identified by 'admin';
Query OK, 0 rows affected (0.10 sec)

mysql> alter user root@'localhost' identified by 'admin';
Query OK, 0 rows affected (0.05 sec)

mysql> show variables like '%valid%pass%';
Empty set (0.01 sec)

mysql> create user root@'%' identified by 'admin';
ERROR 1396 (HY000): Operation CREATE USER failed for 'root'@'%'
mysql> grant all privileges on . to root@'%' with grant option;
Query OK, 0 rows affected (0.08 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql>

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

mysql8安装记录

下载Word文档到电脑,方便收藏和打印~

下载Word文档

猜你喜欢

记录MySQL8 zip版安装过程。

下载、解压缩,不必多说。新建my.ini文件。内容如下图: my.ini [mysql]# 设置mysql客户端默认字符集default-character-set=utf8mb4[mysqld]log-bin=mysql-binserver-id=188
记录MySQL8 zip版安装过程。
2015-12-29

MySQL8-安装

步骤:官网下载 MySQL8 免安装软件包。将下载好的软件解压到指定的路径。在MySQL文件夹根目录创建文件my.ini,将以下内容复制到文件,按需修改地址。#数据库服务端配置项[mysqld]#数据库路径basedir=C:ProgramsOraclemys
MySQL8-安装
2018-09-25

docker安装mysql8

docker run -it --rm --name mysql8 -e MYSQL_ROOT_PASSWORD=root123 -p 3306:3306 -d mysql:last   参数解释 -p 3306:3306:将容器内的3306端口映射到实体机
docker安装mysql8
2017-06-14

MySQL8安装教程

1、下载MySQL安装包安装包解压之后如下:2、初始化MySQL(1). 建立初始化的ini配置文件(my.ini)在解压之后的文件夹中并没有my.ini文件,需要自己创建,文件内容如下:[mysqld]# 设置3306端口port=3306# 设置mysql
MySQL8安装教程
2014-11-01

Debian 10安装 MySQL8

登录mysql官网: https://dev.mysql.com/downloads/   选择: https://dev.mysql.com/downloads/repo/apt/   wget 下载: wget https://dev.mysql.com/
Debian 10安装 MySQL8
2021-10-18

HandlerSocket的安装记录

本篇内容介绍了“HandlerSocket的安装记录”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!HandlerSocket[@more@]
2023-06-04

Centos7 安装 Mysql8教程

Mysql8新特性:Mysql从5.x版本直接跳跃到8.x,我个人是这么看的:MySQL 5.5 -> MySQL 5 MySQL 5.6 -> MySQL 6 MySQL 5.7 -> MySQL 7 MySQL 8.0 -> MySQL
2022-05-12

MYSQL8 多实例安装

多实例出现充分的利用主机资源拆分数据库,限制单个实例大小资源隔离,减小相互影响分担连接数mysql配置文件读取读取配置文件顺序:/etc/my.cnf/etc/mysql/my.cnf/usr/local/mysql/etc/my.cnf~/.my.cnf--

	MYSQL8 多实例安装
2019-03-20

win10 安装 MySQL-5.7.28 记录

目录 一、安装前准备 二、安装步骤 三、安装时踩的坑 一、安装前准备1.云盘下载安装包以及客户端工具下载地址:MySQL-5.7.28 + SQLyog2.官网下载安装包下
win10 安装 MySQL-5.7.28 记录
2016-05-04

Fedora server怎么安装Mysql8

这篇文章主要介绍“Fedora server怎么安装Mysql8”,在日常操作中,相信很多人在Fedora server怎么安装Mysql8问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Fedora serv
2023-06-27

编程热搜

目录