广告
返回顶部
首页 > 资讯 > 数据库 >MySQL8.0.19安装
  • 398
分享到

MySQL8.0.19安装

MySQL8.0.19安装 2020-03-18 01:03:13 398人浏览 无得
摘要

官网下载安装包:Mysql-8.0.19-linux-glibc2.12-x86_64.tar.xz 安装环境:Centos Linux release 7.5.1804 (Core) 解压安装包: xz -d mysql-8.

MySQL8.0.19安装

官网下载安装包:Mysql-8.0.19-linux-glibc2.12-x86_64.tar.xz

安装环境:Centos Linux release 7.5.1804 (Core)

解压安装包:

xz -d mysql-8.0.19-linux-glibc2.12-x86_64.tar.xz
tar -xvf mysql-8.0.19-linux-glibc2.12-x86_64.tar

环境变量:

yum install -y GCc gcc-c++ make cmake automake ncurses-devel bison bison-devel tcp_wrappers-devel libaio libaio-devel perl-Data-Dumper net-tools

创建相关用户和组:

[root@localhost ~]# groupadd mysql
[root@localhost ~]# useradd -g mysql -d /home/mysql -m -p mysql mysql

创建相关目录:

[root@localhost ~]# mkdir -p /data/mysql/;chown -R mysql.mysql /data/mysql/
[root@localhost ~]# mkdir -p /data/tmp/;chown -R mysql.mysql  /data/tmp/

编辑配置文件:

[root@localhost tmp]# vim /etc/my.cnf
[root@localhost mysql]# cat /etc/my.cnf
[client]
port= 3306
Socket  = /tmp/mysql.sock

## The MySQL Server
[mysqld]
port = 3306
socket  = /tmp/mysql.sock
user = mysql
skip-external-locking
skip-name-resolve
#skip-grant-tables
#skip-networking
###################################### dir
basedir=/usr/local/mysql
datadir=/data/mysql
tmpdir=/data/tmp
secure_file_priv=/data/tmp
###################################### some app
log-error=mysql.err
pid-file=/data/mysql/mysql.pid
local-infile=1
event_scheduler=0
federated
default-storage-engine=InnoDB
#default-time-zone= "+8:00"
log_timestamps=SYSTEM
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
init_connect="SET NAMES utf8mb4"

#fulltext
innodb_optimize_fulltext_only
ft_min_Word_len=1
#ft_max_word_len
innodb_ft_min_token_size=1

###################################### memory allocate and myisam configure
max_connections=3000
max_connect_errors=10000

key_buffer_size = 16M
max_allowed_packet = 16M
table_open_cache = 10240
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 2M
join_buffer_size=2M
myisam_sort_buffer_size = 4M
#net_buffer_length = 2M
thread_cache_size = 24


tmp_table_size=1G
max_heap_table_size=1G

#thread_concurrency =48
###################################### replication
server-id = 101096
log-bin=mysql-bin
binlog_fORMat=mixed
max_binlog_size=1G
log_slave_updates=true
log_bin_trust_function_creators=true
binlog_expire_logs_seconds=259200 #binlog过期时间,单位秒
replicate-ignore-db=mysql
replicate-ignore-db=test
replicate-ignore-db=information_schema
replicate-ignore-db=performance_schema
replicate-wild-ignore-table=mysql.%
replicate-wild-ignore-table=test.%
replicate-wild-ignore-table=information_schema.%
replicate-wild-ignore-table=performance_schema.%

lower_case_table_names = 1
#read_only=1
master_info_repository=TABLE
relay_log_info_repository=TABLE

###################################### slow-query
long_query_time=1
slow_query_log=1
slow_query_log_file=/data/mysql/slow-query.log
interactive_timeout=600
wait_timeout=600

###################################### innodb configure
innodb_file_per_table

innodb_data_home_dir = /data/mysql
innodb_log_group_home_dir = /data/mysql
innodb_buffer_pool_size =4G
innodb_log_file_size = 1G
innodb_log_files_in_group = 3
innodb_log_buffer_size = 32M
innodb_flush_log_at_trx_commit = 1
sync_binlog=0
sql-mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO"
##########################################
[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
default-character-set = utf8mb4
prompt=\U \h \R:\m:\s \d>

[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

根目录:

[root@localhost ~]# mv mysql-8.0.19-linux-glibc2.12-x86_64 /usr/local/mysql
[root@localhost ~]# chown -R mysql.mysql /usr/local/mysql

进行初始化,默认密码为空:

[root@localhost ~]# /usr/local/mysql/bin/mysqld  --initialize-insecure --basedir=/usr/local/mysql --datadir=/data/mysql/ --user=mysql

查看日志有没有报错:

[root@localhost ~]# cat /data/mysql/mysql.err
2020-01-20T15:11:46.156633+08:00 0 [System] [MY-013169] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.19) initializing of server in progress as process 14822
 100 200 300 400 500 600 700 800 900 1000
 100 200 300 400 500 600 700 800 900 1000
 100 200 300 400 500 600 700 800 900 1000
2020-01-20T15:12:31.118120+08:00 5 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.

环境变量与开机自启:

[root@localhost mysql]# vim /etc/profile
#在最后添加
export MYSQL_HOME=/usr/local/mysql
PATH=$PATH:$MYSQL_HOME/bin/
[root@localhost mysql]# source /etc/profile

 [root@localhost mysql]# cd /usr/local/mysql
 [root@localhost mysql]# cp -f support-files/mysql.server /etc/init.d/mysqld

 [root@localhost mysql]# chmod 755 /etc/init.d/mysqld

 [root@localhost mysql]# chkconfig --add mysqld

 [root@localhost mysql]# chkconfig mysqld on

启动数据库

[root@localhost mysql]# /etc/init.d/mysqld start
修改密码与创建用户,8.0已取消grant权限自动创建用户,要用create user创建用户再用grant赋予权限:
[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 8
Server version: 8.0.19 MySQL CommUnity Server - GPL

Copyright (c) 2000, 2020, 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.
root@localhost localhost 15:43:29 (none)>ALTER USER "root"@"localhost" IDENTIFIED BY "password";
Query OK, 0 rows affected (0.01 sec)
root@localhost localhost 15:49:30 (none)>CREATE USER ceshi@"localhost" IDENTIFIED BY "password";
Query OK, 0 rows affected (0.01 sec)

root@localhost localhost 15:50:07 (none)>grant SELECT on *.* to "ceshi"@"localhost";
Query OK, 0 rows affected, 1 warning (0.00 sec)

root@localhost localhost 15:51:10 (none)>show grants for ceshi@localhost;
+--------------------------------------------+
| Grants for ceshi@localhost                 |
+--------------------------------------------+
| GRANT SELECT ON *.* TO `ceshi`@`localhost` |
+--------------------------------------------+
1 row in set (0.00 sec)

 

 
您可能感兴趣的文档:

--结束END--

本文标题: MySQL8.0.19安装

本文链接: https://www.lsjlt.com/news/3813.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

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

下载Word文档
猜你喜欢
  • MySQL8.0.19安装
    官网下载安装包:mysql-8.0.19-linux-glibc2.12-x86_64.tar.xz 安装环境:CentOS Linux release 7.5.1804 (Core) 解压安装包: xz -d mysql-8....
    99+
    2020-03-18
    MySQL8.0.19安装
  • MySQL8.0.19安装的示例分析
    这篇文章主要为大家展示了“MySQL8.0.19安装的示例分析”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“MySQL8.0.19安装的示例分析”这篇文章吧。官...
    99+
    2022-10-18
  • 怎么在Linux系统中安装MySQL8.0.19
    本篇文章为大家展示了怎么在Linux系统中安装MySQL8.0.19,内容简明扼要并且容易理解,绝对能使你眼前一亮,通过这篇文章的详细介绍希望你能有所收获。什么是Linux系统Linux是一种免费使用和自由...
    99+
    2022-10-18
  • 安装MySql8.0.19会遇到什么问题
    这篇文章主要介绍了安装MySql8.0.19会遇到什么问题,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。1、ERROR 1820 (HY00...
    99+
    2022-10-18
  • CentOS7.5 安装 Mysql8.0.19的教程图文详解
    一、前言 此篇文章安装mysql部分没有截图,适合有一定基础的同学。 安装方法是通过mysql官网下载的tar文件,解压后安装rpm文件。 因为公司网络慢,使用yum方法安装时,文件经常下载一半就不行了,...
    99+
    2022-10-18
  • Linux系统MySQL8.0.19快速安装配置教程图解
    一、环境介绍 Linux系统使用yum安装MySQL需要从网上下载MySQL的一系列组件,这个过程非常耗时且有下载中断的可能,如果想要快速安装MySQL,可以先在网上将MySQL的离线包下载下来传到系统内进行安装,本...
    99+
    2022-06-03
    linux mysql8.0.19安装配置 mysql8.0.19安装
  • mysql8.0.19忘记密码怎么办
    这篇文章主要介绍了mysql8.0.19忘记密码怎么办,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。MySQL 8.0.19支持输入3次错误...
    99+
    2022-10-18
  • mysql8.0.19基础数据类型详解
    mysql基础数据类型 mysql常用数据类型概览 ![1036857-20170801181433755-146301178](D:\笔记\mysql\复习\1036857-2017080118143...
    99+
    2022-10-18
  • mysql8.0.19忘记密码处理方法详解
    1在配置文件中添加skip-grant-tables后重启mysql,然后直接登录 [root@tyjs09 ~]# cat /etc/my.cnf [mysqld] user=mysql basedir=/applic...
    99+
    2022-07-12
    mysql8.0.19忘记密码处理方法 mysq忘记密码处理
  • 【conda安装】mamba安装 ==conda安装记录
    官方文档 、github地址 mamba文档 mamba安装教程 Mamba 是一个快速、强大且跨平台的包管理器。 它运行在 Windows、OS X 和 Linux(包括 ARM64 和 PPC64...
    99+
    2023-09-03
    conda linux python
  • Linux安装PHP(yum安装和编译安装)
    一、yum安装 更换yum源 Linux更换yum源_清城旧忆的博客-CSDN博客 输入下列代码 yum install -y php 进行验证  cd /var/www/html/ #进入目录tounch index.php ...
    99+
    2023-09-01
    linux 运维
  • 【从0安装】安装nodejs
    1,下载nodejs http://nodejs.cn/download/ 注意下载版本,可能与win7 不能使用。 2,安装,直接点击下一步。 3,查看安装nodejs版本 node -v  查看安装的版本号 npm -v  ...
    99+
    2020-07-14
    【从0安装】安装nodejs
  • pip3安装及dockerscan安装
    cd /usr/local/src/ wget https://www.python.org/ftp/python/3.6.7/Python-3.6.7.tgz wget https://files.pythonhosted.org/pac...
    99+
    2023-01-31
    dockerscan
  • eclipse安装包如何安装
    要安装Eclipse,您可以按照以下步骤进行操作:1. 在Eclipse官网(https://www.eclipse.org/)上下...
    99+
    2023-10-20
    eclipse
  • php安装xlswriter(宝塔安装)
    说明xlswriter需要php7.0以上版本,7.2,7.3,7.4等版本,配置一样,使用xlswriter版本一样,不同php版本,把下面的版本换自己的php版本就可以,下面以宝塔php7.3为搭建环境 下载xlswriter解压 下载...
    99+
    2023-10-24
    php 服务器 linux
  • LAMP(3)安装PHP5、安装PHP7
                                    安装PHP5(目前很多的企业仍然是使用PHP5,因为考虑到兼容的问题)1.先进入到 /usr/local/src目录(因为我把下载的包都统一放在这里)cd /usr/local...
    99+
    2023-01-31
    LAMP
  • eclipse安装包怎么安装
    eclipse安装包怎么安装?步骤如下:首先当然百度一下eclipse,当然一定要选择官网正版,点击进入官网。进入官网之后下拉,你会看到下载按钮(Download,在这我是默认的64位的系统),点击进入。进入之后你会看到付费界面,两种方法:...
    99+
    2019-08-31
    java教程 eclipse
  • Oracle安装(11g)静默安装
           本博文讲述如何在linux系统下静默安装oracle11g(11.2.4.0)。主要用于图形显示不方便的场景,也适用于脚本化批量部署的需要。系统环境OS...
    99+
    2022-10-18
  • 安装Python 后安装Python-d
    安装可能会失败用以下命令就ok了。1.sudo apt-get install aptitude2.sudo aptitude install python-dev ...
    99+
    2023-01-31
    Python
  • python安装需要安装paramiko
    一、介绍1.最近手头有个脚本用于远程批量传输文件的。由于系统本身环境兼容不是很好,所以开始升级配置环境。2.paramiko是用python语言写的一个模块,遵循SSH2协议,支持以加密和认证的方式,进行远程服务器的连接。由于使用的是pyt...
    99+
    2023-01-31
    python paramiko
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作