mysql-5.7.24初始化数据库_MySQL5.7.28 初始化数据库
1)初始化随机密码 mysqld --initialize
[root@host-172-16-61-102 bin]# ./mysqld --initialize
2020-02-15T07:01:38.309015Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-02-15T07:01:38.309069Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2020-02-15T07:01:38.497402Z 0 [Warning] InnoDB: New log files created, LSN=45790
2020-02-15T07:01:38.541219Z 0 [Warning] InnoDB: Creating foreign key constraint system
tables.
2020-02-15T07:01:38.553509Z 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: 02fb69c1-4fc1-11ea-8b4e-fa163d34f78d.
2020-02-15T07:01:38.556591Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2020-02-15T07:01:38.980429Z 0 [Warning] CA certificate ca.pem is self signed.
2020-02-15T07:01:39.723869Z 1 [Note] A temporary password is generated for root@localhost: +:NoRLu2kwhd
生成的密码是:+:NoRLu2kwhd
以上的指令,默认读取配置文件/etc/my.cnf,需要/etc/my.cnf文件中指定了数据库的地址,并且生成一个root用户的密码,还有如下的参数可以设置
--user=mysql //生成指定用户的密码
--datadir=/opt/mysql/mysql/data //指定生成的数据库数据地址
--defaults-file=/opt/mysql/mysql/etc/my.cnf//指定读取的配置文件,取代默认的配置
2)初始化空密码 mysqld --initialize-insecure
启动mysqld服务 ./mysqld --user=root
创建密码
[root@host-172-16-61-102 bin]# mysql -uroot -p
//提示密码输入,直接回车
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.7.28 MySQL xxx
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
//为root创建密码
MySQL [(none)]> set password = password("root");
Query OK, 0 rows affected, 1 warning (0.00 sec)
MySQL [(none)]> quit
注意:执行“mysqld --initialize”报错了。提示“initialize specified but the data directory has files in it. Aborting”,大意是提示/opt/mysql/mysql/data数据库地址下有文件,导致无法初始化数据库,这个时候,可以进入到该目录,将所有的数据删除,说明之前已经初始化过
mysql-5.7.24初始化数据库_MySQL5.7.28 初始化数据库相关推荐
- mysql5.7.20+初始化_MySQL5.7.28 初始化数据库
1)初始化随机密码 mysqld --initialize [root@host-172-16-61-102 bin]# ./mysqld --initialize 2020-02-15T07: ...
- mysql重启root不能登_Mysql 5.7.28初始化使用root无法登录
背景: 新买的云服务器,Ubuntu系统,在线安装了mysql-5.7.28,初始化之后并成功启动 问题: 打开error.log日志,使用root账号登录失败,从日志中也无法找到临时密码,无法登录 ...
- mysql 5.7 删除数据库_MySQL5.7(二)数据库的基本操作
登录MySQL数据库 格式:mysql -u 用户名 -h 主机名或IP地址 -P 端口号 -p 密码 1.显示数据库 SHOW DATABASES; MySQL5.7.20默认数据库 inform ...
- mysql 5.0 数据库_mysql5.0常用命令
MySQL常用操作基本操作,以下都是MySQL5.0下测试通过首先说明下,记住在每个命令结束时加上:(分号) 1.导出整个数据库 mysqldump -u 用户名 -p --default-chara ...
- mysql 5.0 数据库_mysql5.0创建数据库
CentOS6.5下通过Shell创建.备份.还原MySQL数据库 CentOS6.5下通过Shell创建.备份.还原MySQL数据库 创建数据库: mysql -uroot -p123456 -e ...
- mysql数据库应用经典案例_MySQL数据库“十宗罪”(十大经典错误案例)
Top 1: Too many connections(连接数过多,导致连接不上数据库,业务无法正常进行) 问题还原 解决问题的思路: 1.首先先要考虑在我们 MySQL 数据库参数文件里面,对应的 ...
- centOS7 单机 mysql 5.7.24 主从
centOS7 单机 mysql 5.7.24 主从 文章目录 centOS7 单机 mysql 5.7.24 主从 背景 环境 安装 下载 mysql5.7 二进制压缩包 解压 mysql5.7 二 ...
- mysql数据库字段类型大全_mysql数据库字段类型详解
MySQL支持大量的列类型,它可以被分为3类:数字类型.日期和时间类型以及字符串(字符)类型.本节首先给出可用类型的一个概述,并且总结每个列类型的存储需求,然后提供每个类中的类型性质的更详细的描述. ...
- mysql 8.0.24 安装配置方法图文教程
文章来源: 学习通http://www.bdgxy.com/ 普学网http://www.boxinghulanban.cn/ 智学网http://www.jaxp.net/ 本文为大家分享了mysq ...
最新文章
- CentOS7.2中NFS1.3 安装
- 第六章 ORacle权限设置、schema、通过profile 限制用户恶意登录、通过profile限制使用期限
- 使用php蓝天采集器抓取今日头条ajax的文章内容
- 你需要了解的有关.NET日期时间的必要信息
- MySQL 练习 创建表格2
- day02【后台】管理员登录
- 几句话实现导航栏透明渐变 – iOS
- 常见移动机器人轮直径校准实现(ROS)方法
- java打字小游戏源码_java实现快速打字游戏
- 十五至尊图(第六版)
- android 模拟内存不足,雷电模拟器内存不足怎么办?雷电安卓模拟器怎么修改内存大小?...
- 基于C语言设计的无边框背景透明窗体
- python 吉他_Python中用于比较吉他弦的Matplotlib幅值_频谱单位
- OAI配置eNB时error解决
- java自行车北京_JAVA公共自行车地图api调用代码实例
- 常见排序算法时间复杂度和空间复杂度
- linux系统实训总结报告,Linux操作系统实验报告.doc
- 打印机服务器怎么配置文件,打印机服务器ftp配置文件
- 搭建vue项目环境以及创建一个简单的vue的demo
- 【java基础面向对象】方法的重写、 package和import包、访问控制修饰符,static,final,static final,抽象方法
热门文章
- 【操作系统复习】操作系统的运行机制与体系结构
- Leetcode--142. 环形链表Ⅱ
- mysql sql实现原理_Mysql的数据库原理
- python中难的算法_一个python的比较难的算法,有懂的人可以进来一下
- 网站程序数据库怎么上传到服务器上,网站的数据库怎么上传到服务器
- MATLAB的GUI如何清空坐标轴的图像
- python用Matplotlib画箭头
- RandomShuffleQueue '_1_input/shuffle_batch/random_shuffle_queue' is closed and has insufficient elem
- python保存和加载数组
- tf.while_loop