mysql8安装以及配置、参数优化

2023-11-04

1.配置bin到path

2.mysql解压版本在根目录创建my.ini

3.初始化数据库:mysqld --initialize --console ,这里会生成一个初始密码,需要记录下来,否则需要删除datadir目录重新初始化

D:\dev\mysql-8.0.11-winx64>mysqld --initialize --console

2018-06-17T21:06:14.524974Z 0 [System] [MY-013169] [Server] D:\dev\mysql-8.0.11-winx64\bin\mysqld.exe (mysqld 8.0.11) initializing of server in progress as process 3768

2018-06-17T21:06:31.388939Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: i7TntpLMiL,s

2018-06-17T21:06:42.137554Z 0 [System] [MY-013170] [Server] D:\dev\mysql-8.0.11-winx64\bin\mysqld.exe (mysqld 8.0.11) initializing of server has completed

 

4.安装服务:mysqld --install 服务名 ,服务名可以是任意,最好如:mysql5、mysql8等以便区分(这里以mysql8作为服务名)

mysqld --verbose --help 查看帮助(帮助文档参数较大,需要打印到文本查看)

卸载服务: mysqld --remove mysql8

D:\dev\mysql-8.0.11-winx64>mysqld --install MySQL8

Service successfully installed.

打开MySQL8查看:

启动~~~(我这边自己电脑可执行文件路径始终隐射到C:\Program Files\MySQL,而不是我实际安装目录)

5.更改密码:(需要手动启动上面到服务)

mysql -u root -p 输入第3步的密码

在mysql shell中执行:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';

注:修改默认密码验证插件:shell> mysql --default-auth=mysql_old_password ...

mysql_old_password为老版本验证方式,到mysql5.7.5已经废弃。新版使用mysql_native_password

https://dev.mysql.com/doc/refman/5.7/en/old-native-pluggable-authentication.html

 

my.ini文件内容:

实际测试中包含表格中参数都是可以通过初始化的,以下几个参数会报错:

'query_cache_size=0'

'innodb_additional_mem_pool_size=2M'

'query_cache_type=0'

以下为正确的,需要修改对应basedir和datadir

# Other default tuning values

# MySQL Server Instance Configuration File

# ----------------------------------------------------------------------

# Generated by the MySQL Server Instance Configuration Wizard

#

#

# Installation Instructions

# ----------------------------------------------------------------------

#

# On Linux you can copy this file to /etc/my.cnf to set global options,

# mysql-data-dir/my.cnf to set server-specific options

# (@localstatedir@ for this installation) or to

# ~/.my.cnf to set user-specific options.

#

# On Windows you should keep this file in the installation directory

# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To

# make sure the server reads the config file use the startup option

# "--defaults-file".

#

# To run run the server from the command line, execute this in a

# command line shell, e.g.

# mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"

#

# To install the server as a Windows service manually, execute this in a

# command line shell, e.g.

# mysqld --install MySQLXY --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"

#

# And then execute this in a command line shell to start the server, e.g.

# net start MySQLXY

#

#

# Guildlines for editing this file

# ----------------------------------------------------------------------

#

# In this file, you can use all long options that the program supports.

# If you want to know the options a program supports, start the program

# with the "--help" option.

#

# More detailed information about the individual options can also be

# found in the manual.

#

# For advice on how to change settings please see

# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html

#

#

# CLIENT SECTION

# ----------------------------------------------------------------------

#

# The following options will be read by MySQL client applications.

# Note that only client applications shipped by MySQL are guaranteed

# to read this section. If you want your own MySQL client program to

# honor these values, you need to specify it as an option during the

# MySQL client library initialization.

#

[client]

no-beep

 

# pipe

# socket=0.0

port=3306

 

[mysql]

 

default-character-set=utf8

 

 

# SERVER SECTION

# ----------------------------------------------------------------------

#

# The following options will be read by the MySQL Server. Make sure that

# you have installed the server correctly (see above) so it reads this

# file.

#

# server_type=3

[mysqld]

 

# The next three options are mutually exclusive to SERVER_PORT below.

# skip-networking

 

# enable-named-pipe

 

# shared-memory

 

# shared-memory-base-name=MYSQL

 

# The Pipe the MySQL Server will use

# socket=MYSQL

 

# The TCP/IP Port the MySQL Server will listen on

port=3306

 

# Path to installation directory. All paths are usually resolved relative to this.

#basedir="C:/Program Files/MySQL/MySQL Server 5.6/"

 

# Path to the database root

#datadir=C:/ProgramData/MySQL/MySQL Server 5.6/Data

 

basedir=D:/dev/mysql-8.0.11-winx64/

datadir=D:/dev/mysql-8.0.11-winx64/data

 

 

# The default character set that will be used when a new schema or table is

# created and no character set is defined

character-set-server=utf8

 

# The default storage engine that will be used when create new tables when

default-storage-engine=INNODB

 

 

# Enable Windows Authentication

# plugin-load=authentication_windows.dll

 

 

# Server Id.

server-id=1

 

# The maximum amount of concurrent sessions the MySQL server will

# allow. One of these connections will be reserved for a user with

# SUPER privileges to allow the administrator to login even if the

# connection limit has been reached.

max_connections=151

 

 

 

# The number of open tables for all threads. Increasing this value

# increases the number of file descriptors that mysqld requires.

# Therefore you have to make sure to set the amount of open files

# allowed to at least 4096 in the variable "open-files-limit" in

# section [mysqld_safe]

table_open_cache=2000

 

# Maximum size for internal (in-memory) temporary tables. If a table

# grows larger than this value, it is automatically converted to disk

# based table This limitation is for a single table. There can be many

# of them.

tmp_table_size=12M

 

# How many threads we should keep in a cache for reuse. When a client

# disconnects, the client's threads are put in the cache if there aren't

# more than thread_cache_size threads from before. This greatly reduces

# the amount of thread creations needed if you have a lot of new

# connections. (Normally this doesn't give a notable performance

# improvement if you have a good thread implementation.)

thread_cache_size=10

 

#*** MyISAM Specific options

# The maximum size of the temporary file MySQL is allowed to use while

# recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.

# If the file-size would be bigger than this, the index will be created

# through the key cache (which is slower).

myisam_max_sort_file_size=100G

 

# If the temporary file used for fast index creation would be bigger

# than using the key cache by the amount specified here, then prefer the

# key cache method. This is mainly used to force long character keys in

# large tables to use the slower key cache method to create the index.

myisam_sort_buffer_size=15M

 

# Size of the Key Buffer, used to cache index blocks for MyISAM tables.

# Do not set it larger than 30% of your available memory, as some memory

# is also required by the OS to cache rows. Even if you're not using

# MyISAM tables, you should still set it to 8-64M as it will also be

# used for internal temporary disk tables.

key_buffer_size=8M

 

# Size of the buffer used for doing full table scans of MyISAM tables.

# Allocated per thread, if a full scan is needed.

read_buffer_size=30K

read_rnd_buffer_size=256K

 

#*** INNODB Specific options ***

# innodb_data_home_dir=0.0

 

# Use this option if you have a MySQL server with InnoDB support enabled

# but you do not plan to use it. This will save memory and disk space

# and speed up some things.

# skip-innodb

 

 

# If set to 1, InnoDB will flush (fsync) the transaction logs to the

# disk at each commit, which offers full ACID behavior. If you are

# willing to compromise this safety, and you are running small

# transactions, you may set this to 0 or 2 to reduce disk I/O to the

# logs. Value 0 means that the log is only written to the log file and

# the log file flushed to disk approximately once per second. Value 2

# means the log is written to the log file at each commit, but the log

# file is only flushed to disk approximately once per second.

innodb_flush_log_at_trx_commit=1

 

# The size of the buffer InnoDB uses for buffering log data. As soon as

# it is full, InnoDB will have to flush it to disk. As it is flushed

# once per second anyway, it does not make sense to have it very large

# (even with long transactions).

innodb_log_buffer_size=1M

 

# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and

# row data. The bigger you set this the less disk I/O is needed to

# access data in tables. On a dedicated database server you may set this

# parameter up to 80% of the machine physical memory size. Do not set it

# too large, though, because competition of the physical memory may

# cause paging in the operating system. Note that on 32bit systems you

# might be limited to 2-3.5G of user level memory per process, so do not

# set it too high.

innodb_buffer_pool_size=32M

 

# Size of each log file in a log group. You should set the combined size

# of log files to about 25%-100% of your buffer pool size to avoid

# unneeded buffer pool flush activity on log file overwrite. However,

# note that a larger logfile size will increase the time needed for the

# recovery process.

innodb_log_file_size=48M

 

# Number of threads allowed inside the InnoDB kernel. The optimal value

# depends highly on the application, hardware as well as the OS

# scheduler properties. A too high value may lead to thread thrashing.

innodb_thread_concurrency=9

 

# The increment size (in MB) for extending the size of an auto-extend InnoDB system tablespace file when it becomes full.

innodb_autoextend_increment=64

 

# The number of regions that the InnoDB buffer pool is divided into.

# For systems with buffer pools in the multi-gigabyte range, dividing the buffer pool into separate instances can improve concurrency,

# by reducing contention as different threads read and write to cached pages.

innodb_buffer_pool_instances=8

 

# Determines the number of threads that can enter InnoDB concurrently.

innodb_concurrency_tickets=5000

 

# Specifies how long in milliseconds (ms) a block inserted into the old sublist must stay there after its first access before

# it can be moved to the new sublist.

innodb_old_blocks_time=1000

 

# It specifies the maximum number of .ibd files that MySQL can keep open at one time. The minimum value is 10.

innodb_open_files=300

 

# When this variable is enabled, InnoDB updates statistics during metadata statements.

innodb_stats_on_metadata=0

 

# When innodb_file_per_table is enabled (the default in 5.6.6 and higher), InnoDB stores the data and indexes for each newly created table

# in a separate .ibd file, rather than in the system tablespace.

innodb_file_per_table=1

 

# Use the following list of values: 0 for crc32, 1 for strict_crc32, 2 for innodb, 3 for strict_innodb, 4 for none, 5 for strict_none.

innodb_checksum_algorithm=0

 

# The number of outstanding connection requests MySQL can have.

# This option is useful when the main MySQL thread gets many connection requests in a very short time.

# It then takes some time (although very little) for the main thread to check the connection and start a new thread.

# The back_log value indicates how many requests can be stacked during this short time before MySQL momentarily

# stops answering new requests.

# You need to increase this only if you expect a large number of connections in a short period of time.

back_log=80

 

# If this is set to a nonzero value, all tables are closed every flush_time seconds to free up resources and

# synchronize unflushed data to disk.

# This option is best used only on systems with minimal resources.

flush_time=0

 

# The minimum size of the buffer that is used for plain index scans, range index scans, and joins that do not use

# indexes and thus perform full table scans.

join_buffer_size=256K

 

# The maximum size of one packet or any generated or intermediate string, or any parameter sent by the

# mysql_stmt_send_long_data() C API function.

max_allowed_packet=4M

 

# If more than this many successive connection requests from a host are interrupted without a successful connection,

# the server blocks that host from performing further connections.

max_connect_errors=100

 

# Changes the number of file descriptors available to mysqld.

# You should try increasing the value of this option if mysqld gives you the error "Too many open files".

open_files_limit=4161

 

# If you see many sort_merge_passes per second in SHOW GLOBAL STATUS output, you can consider increasing the

# sort_buffer_size value to speed up ORDER BY or GROUP BY operations that cannot be improved with query optimization

# or improved indexing.

sort_buffer_size=256K

 

# The number of table definitions (from .frm files) that can be stored in the definition cache.

# If you use a large number of tables, you can create a large table definition cache to speed up opening of tables.

# The table definition cache takes less space and does not use file descriptors, unlike the normal table cache.

# The minimum and default values are both 400.

table_definition_cache=1400

 

# Specify the maximum size of a row-based binary log event, in bytes.

# Rows are grouped into events smaller than this size if possible. The value should be a multiple of 256.

binlog_row_event_max_size=8K

 

# If the value of this variable is greater than 0, a replication slave synchronizes its master.info file to disk.

# (using fdatasync()) after every sync_master_info events.

sync_master_info=10000

 

# If the value of this variable is greater than 0, the MySQL server synchronizes its relay log to disk.

# (using fdatasync()) after every sync_relay_log writes to the relay log.

sync_relay_log=10000

 

# If the value of this variable is greater than 0, a replication slave synchronizes its relay-log.info file to disk.

# (using fdatasync()) after every sync_relay_log_info transactions.

sync_relay_log_info=10000

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

mysql8安装以及配置、参数优化 的相关文章

  • 游戏数据存储的四种常用方式

    原文地址 http blog csdn net xiaominghimi article details 6948046 首先向大家说句抱歉 可能一些童鞋看到我的微薄了 我说突然不想写博客了 是Himi的错 我不该发微薄让大家担心的 Him
  • 一篇文章看懂Oracle开窗函数

    聚合类开窗函数 聚合类开窗函数类似分组函数group by中的sum avg count max min 等等 但是开窗函数不会像分组聚合函数一样按照分组返回结果 而是有多少行记录就返回多少个结果 结果输出的形式是单独一列进行输出 举个例子
  • 复合查询

    复合查询 1 单表查询 查询工资高于500或岗位为MANAGER的雇员 同时还要满足他们的姓名首字母为大写的J select empno ename sal job from emp where sal gt 500 or job MANA
  • 分页(Paging) / SQL Server / Oracle

    分页 Paging SQL Server Oracle 虽然 DataGrid 控件自己带了一个分页处理机制 但它是将符合查询条件的所有记录读入内存 然后进行分页显示的 随着符合条件的记录数目增多 就会出现运行效率问题 或者至少是资源的利用
  • mysql8安装以及配置、参数优化

    1 配置bin到path 2 mysql解压版本在根目录创建my ini 3 初始化数据库 mysqld initialize console 这里会生成一个初始密码 需要记录下来 否则需要删除datadir目录重新初始化 D dev my
  • MySQL JDBC URL参数

    参数清单 属性名 定义 要求 默认值 版本 Connection Authentication 连接 鉴定 user 连接的用户 No 全部 password 连接时使用的密码 No 全部 socketFactory 驱动程序用于创建与服务
  • 【Hive报错】Hive报错Expression Not In Group By Key解决方法

    SQL例如以下会报错 select sum time as time roadCoding upstreamOrDownstream from historicalroaddata where 报以下roadcoding upstreamO
  • 常用数据库 validationQuery 语句

    在配置数据库连接池的时候 有一个选项validationQuery 该选项用来验证数据库连接的有效性 下表是从网上收集的常用数据库的validationQuery语句 数据库 validationQuery Oracle select 1
  • 数据库 SQL 遍历父子关系表(二叉树)获得所有子节点 所有父节点

    数据库 SQL 遍历父子关系表 二叉树 获得所有子节点 所有父节点 创建表 Create Table A IDInt fatherIDInt NameVarchar 10 Insert A Select 1 NULL tt Union Al
  • SQL中根据经纬度计算两点之间的直线距离

    最近接到一个需求获取当前用户的经纬度 然后计算与目标地的的距离 我自己也是看别人的博客学习 自己也做个记录吧 直接放出计算的公式 不想浪费时间的 直接看公式套进去就成 依次是纬度 纬度 经度 round 6378 138 2 ASIN SQ
  • 数据库复习(4) 实体关系模型

    实体集 Entity Sets 是实际存在的事物 可以是抽象的 具有属性 attributes 实体集是具有共同性质的同类实体的集合 实体集的属性类型划分 简单的和复合的 conposite 如名字等等 单值的 多值的 如电话号码等 直接的
  • 你知道什么是DBA吗?

    数据库管理员 英文是Database Administrator 简称DBA 这个职位对不同的人意味着不同的意义 一个小的软件开发工作室和一个分工高度明细的大公司相比 DBA的职责来得更加宽泛一些 一个公司 不管它是自己开发应用软件 还是购
  • SQL--多表查询(多表联查,如:LEFT JOIN、LEFT JOIN、LEFT JOIN、UNION ALL等)

    1 常见多表连接的三种方式 LEFT JOIN 左连接 查询左表所有数据和右表与左表属性值相等的记录 SELECT FROM TABELONE A LEFT JOIN TABELTWO B ON A id B id RIGHT JOIN 右
  • 啥是ddl?

    我们在安装软件的时候 经常出现某一个dll文件丢失 无法安装 让人头痛不已 那么到底啥是ddl 还是有度娘好呀 下面是百度百科的词条 数据库模式定义语言DDL Data Definition Language 是用于描述数据库中要存储的现实
  • 什么叫持久化? 为什么持久化?(转)

    1 应用程序层次结构演变 这里本来应该有张描述应用程序结构演变的图 可是CSDN在这里上传不了 所以没有传上来 纵观几十年的计算机应用软件的演变过程 应用程序逐渐由单层体系结构发展为多层体系结构 最初应用软件只是在大型机上的单层应用程序 大
  • Python数据库操作手册

    数据库的操作在现在的Python里面已经变得十分的好用 有了一套API标准 下面的就是讲讲如何的去使用这套框架定义 此框架包含以下部分 模块接口 连接对象 游标对象 DBI辅助对象 数据类型与定义 如何实现的提示 从1 0到2 0的变化 例
  • MySql 笔记

    数据结构 B TREE 二叉树 顺序增长依次查询效率低 红黑树 数据多了深度越深 效率自然低了 HASH 查询条件限制 B TREE 度 degree 节段的数据存储个数 叶节点具有 相同的深度 叶节点的指针为空 节点的数据key从左到右递
  • oracle 从一个oracle导数据到另外一个oracle(二)

    场景 原有数据库A突然宕掉了 新搭建了数据库B应急 A启动后要把A上的数据迁移到B上 限制 1 A数据库是Oracle10g B数据库是Oracle11g 2 A的字符集是AMERICAN AMERICA ZHS16GBK B的字符集是AM
  • oracle9i升级oracle10g

    author skate time 2009 09 11 网上看到一篇oracle9i升级oracle10g的文章 觉得不错 记录下来 你可以参考汪海的文章 http wzwanghai spaces live com 37AFBD116
  • (转载)我们需要什么样的字段类型

    数据库定义到char类型的字段时 不知道大家是否会犹豫一下 到底选char nchar varchar nvarchar text ntext中哪一种呢 结果很可能是两种 一种是节俭人士的选择 最好是用定长的 感觉比变长能省些空间 而且处理

随机推荐

  • 【面试题】-java分布式及微服务面试题汇总

    目录 1 CAP理论 2 BASE理论 3 接口的幂等性问题 4 消息中间件如何解决消息丢失问题 5 什么是分布式事务 分布式事务的类型有哪些 6 分布式事务的解决方案有哪些 7 Dubbo的服务请求失败怎么处理 10 Soa和微服务架构有
  • 二叉树中序线索化与遍历(c)

    对下图的二叉树进行 1 创建一个带线索域的二叉树 数据类型如下 typedef struct 当 tag 为0时 代表child 正常指向下一个节点 当tag为1时 child为线索 其中 lchild 为指向中序遍历前驱 rchild 为
  • 中级职称的计算机考试题库,中级职称计算机考试模拟题库及答案

    资料仅供参考 中级职称计算机考试模拟题库及答案 1 计算机中数据的表示形式是 C A 八进制 B 十进制 C 二进制 D 十六进制 2 硬盘工作时应特别注意避免 B A 噪声 B 震动 C 潮湿 D 日光 3 下面列出的四种存储器中 易失性
  • 好像还挺好玩的GAN5——Keras搭建COGAN耦合生成式对抗网络

    好像还挺好玩的GAN5 Keras搭建COGAN耦合生成式对抗网络 学习前言 什么是COGAN 神经网络构建 1 Generator 2 Discriminator 训练思路 实现全部代码 学习前言 发现一个挺有意思的结构 可以通过同一个输
  • Unity实现扇形小地图的区域检测

    说明 最近接到一个需求 在一个雷达界面 扇形UI 的界面上显示出三维场景中真实的物体显示情况 我的思路就是一个三维场景某物体的位置映射到二维UI界面上 实现思路 物体到扇形原点的距离需要小于扇形半径的距离 否则就不在扇形范围内 物体与扇形原
  • 【git】 无法commit问题

    今天写完代码git commit m 一下发现提示 Another git process seems to be running in this repository e g an editor opened by git commit
  • 2022-10-20 Linux LED灯驱动gpio-leds心跳呼吸灯heartbeat、timer,路径/sys/bus/platform/devices/leds

    一 测试环境 Android 9 系统 二 驱动文件在 kernel drivers leds leds gpio c 三 dts的官方配置文档 kernel Documentation devicetree bindings leds l
  • Idea 使用技巧(MAC)

    记住符 打标快捷键 Ctrl Shift 任意数字 查标快捷键 Ctrl 任意数字 在Idea查看标签相关操作 Navigate Bookmarks 快捷键设置 intellij Preferencs keyMaps 快捷键 顶部 fn c
  • crontab每分钟执行一次任务

    0 实例 在 home 下面写了一个test sh bin sh echo hello gt home hello txt echo hello hello hello hello gt gt home hello txt 还是用这个比较好
  • 五、C++语言初阶:文件

    5 文件 5 1 流 流 数据从一个对象到另一个对象的传输 功能 标准输入输出 文件处理 分类 含义 文本流 一串ASCII字符 二进制流 一串二进制 5 2 流类型 标准库定义了三大类流类型 标准I O流 文件流 字符串流 标准I O流
  • Kaggle 数据竞赛

    文章目录 一 前言 二 主要内容 1 评估 2 时间线 3 奖金 4 代码要求 三 总结 CSDN 叶庭云 https yetingyun blog csdn net 一 前言 使用机器学习技术 通过匿名健康特征的测量数据来检测疾病 比赛目
  • 动力节点最新Java17零基础视频第二章 初识Java

    计算机概述 计算机是一种现代化的电子设备 它能够接受 存储 处理和输出数据 计算机由硬件和软件两部分组成 硬件包括中央处理器 CPU 内存 硬盘 显示器 键盘 鼠标等部件 软件则包括系统软件和应用软件 计算机可以进行各种操作 如文字处理 图
  • 当定制化的呼声响起,MaaS就在百融云的掌心

    中国的TMT产业 似乎每隔几年都要经历一轮痛苦的反思 而这次的新课题 是AI到底能不能拯救中国的软件行业 大洋彼岸的Adobe 用订阅制付费牢牢拴住离不开自己的专业视频剪辑用户 Shopify用收租的模式 为电商卖家提供搭建网店的技术和模版
  • BigDecimal基本知识

    在我们的日常计算中 有时会涉及到比较大的数字之间的计算 如 超大金额的计算 如果是韩元等的话 还要大 这时 使用float double这样的浮点数就不那么准确了 因为不论是float 还是double都是浮点数 而计算机是二进制的 浮点数
  • 如何使用github中的pull request功能?

    pull request是社会化编程的象征 通过这个功能 你可以参与到别人开发的项目中 并做出自己的贡献 pull request是自己修改源代码后 请求对方仓库采纳的一种行为 github入门与实践 下面具体说一下github中使用pul
  • Unity TimeLine实用功能讲解

    这一个技术相对于其他动画系统 最大的区别就是 TimeLine针对多个游戏物体做出的一系列动画 主要用于过场动画的制作 实现电影级的那种分镜效果 注意 使用TimeLine需要2017以上的版本 在菜单栏中点Window 找到TimeLin
  • uView 中 Steps 步骤条,竖向步骤条不展示

    问题描述 Steps 步骤条在竖向时候步骤条竖线不展示 解决方法 找到uview ui components u steps item u steps item vue文件 设置 style height 100 即可 如图
  • 如何在MacOS上玩儿汇编?

    在Mac上写汇编还是相当方便的 本文通过写一个Helloworld程序来入门 首先 MacOS 自带nasm 只是版本有点老 编译不了64位程序 只要上官网下一个最新的 替换一下就行了 有一点需要注意的是mac上gcc编译 o文件的默认入口
  • jquery笔记

    收起展开
  • mysql8安装以及配置、参数优化

    1 配置bin到path 2 mysql解压版本在根目录创建my ini 3 初始化数据库 mysqld initialize console 这里会生成一个初始密码 需要记录下来 否则需要删除datadir目录重新初始化 D dev my