安装mysql5.7

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS PostgreSQL,集群系列 2核4GB
简介: 下载mysql5.7.tar.gz直接解压运行mysql

wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.29-linux-glibc2.12-x86_64.tar.gz

tar -zxf /app/mysql-5.7.29-linux-glibc2.12-x86_64.tar.gz -C /usr/local

cd /usr/local

mv mysql-5.7.29-linux-glibc2.12-x86_64/ mysql

groupadd mysql && useradd -r -g mysql -s /sbin/nologin mysql

mkdir ./mysql/data

chown -R mysql:mysql ./mysql

cd mysql/bin/

./mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

2021-08-03T17:45:32.410008Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-08-03T17:45:32.577914Z 0 [Warning] InnoDB: New log files created, LSN=45790
2021-08-03T17:45:32.607983Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2021-08-03T17:45:32.665963Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 99b563cd-f482-11eb-a447-000c29ae3fa1.
2021-08-03T17:45:32.666838Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-08-03T17:45:33.123053Z 0 [Warning] CA certificate ca.pem is self signed.
2021-08-03T17:45:33.470176Z 1 [Note] A temporary password is generated for root@localhost: oXsKgc6rtt=n

A temporary password is generated for root@localhost: oXsKgc6rtt=n

./mysqld_safe #启动mysql

初始化mysql

./mysql_secure_installation

mysql_secure_installation: [ERROR] unknown variable 'default-character-set=utf8'
Securing the MySQL server deployment.
Enter password for user root: #输入密码

The existing password for the user account root has expired. Please set a new password.
New password:
Re-enter new password: #设置新密码

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: n #密码检查

Change the password for root ? ((Press y|Y for Yes, any other key for No) : y
New password:
Re-enter new password: #确认修改密码(在输入一边新密码)

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y #删除匿名用户
Success.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n #是否允许root远程登陆

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y #删除测试数据库

  • Dropping test database...

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y #刷新,即刻生效
Success.

update mysql.user set authentication_string=password('biosan#17') where user='root' ;
GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'biosan#17' WITH GRANT OPTION;
flush privileges;
update mysql.user set authentication_string=password('123456') where user='root'

-> ;

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> alter user user() identified by "123456";
Query OK, 0 rows affected (0.00 sec)

相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
1月前
|
关系型数据库 MySQL 数据库
Docker Compose V2 安装常用数据库MySQL+Mongo
以上内容涵盖了使用 Docker Compose 安装和管理 MySQL 和 MongoDB 的详细步骤,希望对您有所帮助。
175 42
|
2月前
|
安全 关系型数据库 MySQL
CentOS7仅安装部署MySQL80客户端
通过上述步骤,你可以在CentOS 7上成功安装并配置MySQL 8.0客户端。这个过程确保你能够使用MySQL客户端工具连接和管理远程的MySQL数据库,而不需要在本地安装MySQL服务器。定期更新MySQL客户端可以确保你使用的是最新的功能和安全修复。
276 16
|
2月前
|
关系型数据库 MySQL 应用服务中间件
《docker基础篇:8.Docker常规安装简介》包括:docker常规安装总体步骤、安装tomcat、安装mysql、安装redis
《docker基础篇:8.Docker常规安装简介》包括:docker常规安装总体步骤、安装tomcat、安装mysql、安装redis
152 7
|
3月前
|
NoSQL 关系型数据库 Redis
《docker高级篇(大厂进阶):1.Docker复杂安装详说》包括:安装mysql主从复制、安装redis集群
《docker高级篇(大厂进阶):1.Docker复杂安装详说》包括:安装mysql主从复制、安装redis集群
144 14
|
3月前
|
安全 关系型数据库 MySQL
Windows Server 安装 MySQL 8.0 详细指南
安装 MySQL 需要谨慎,特别注意安全配置和权限管理。根据实际业务需求调整配置,确保数据库的性能和安全。
375 9
|
3月前
|
关系型数据库 MySQL 数据库
【MySQL基础篇】MySQL概述、Windows下载MySQL8.0超详细图文安装教程
在这一章节,主要介绍两个部分,数据库相关概念及MySQL数据库的介绍、下载、安装、启动及连接。接着,详细描述了MySQL 8.0的版本选择与下载,推荐使用社区版(免费)。安装过程包括自定义安装路径、配置环境变量、启动和停止服务、以及客户端连接测试。此外,还提供了在同一台电脑上安装多个MySQL版本的方法及卸载步骤。最后,解释了关系型数据库(RDBMS)的特点,即基于二维表存储数据,使用SQL语言进行操作,格式统一且便于维护。通过具体的结构图展示了MySQL的数据模型,说明了数据库服务器、数据库、表和记录之间的层次关系。
【MySQL基础篇】MySQL概述、Windows下载MySQL8.0超详细图文安装教程
|
3月前
|
NoSQL 关系型数据库 MySQL
Linux安装jdk、mysql、redis
Linux安装jdk、mysql、redis
262 7
|
3月前
|
关系型数据库 MySQL 数据库
docker高级篇(大厂进阶):安装mysql主从复制
docker高级篇(大厂进阶):安装mysql主从复制
136 24
|
4月前
|
运维 关系型数据库 MySQL
安装MySQL8数据库
本文介绍了MySQL的不同版本及其特点,并详细描述了如何通过Yum源安装MySQL 8.4社区版,包括配置Yum源、安装MySQL、启动服务、设置开机自启动、修改root用户密码以及设置远程登录等步骤。最后还提供了测试连接的方法。适用于初学者和运维人员。
348 0
|
4月前
|
SQL 关系型数据库 MySQL
go语言数据库中mysql驱动安装
【11月更文挑战第2天】
145 4

推荐镜像

更多