博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
MySql新版本安装配置
阅读量:5020 次
发布时间:2019-06-12

本文共 1728 字,大约阅读时间需要 5 分钟。

版本:mysql-5.7.16-winx64

平台Windows 7 x64

1、进入mysql主目录(建议将其移到C或D盘的根目录,并改名为mysql)

2、配置path环境变量(如D:\JAVA\mysql)添加到环境变量中。

3、mysql主目录下的my-default.ini文件改名为my.ini,最简单配置如下

# For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the# *** default location during install, and will be replaced if you# *** upgrade to a newer version of MySQL.[mysqld]# Remove leading # and set to the amount of RAM for the most important data# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.# innodb_buffer_pool_size = 128M# Remove leading # to turn on a very important data integrity option: logging# changes to the binary log between backups.# log_bin# These are commonly set, remove the # and set as required.basedir = D:\JAVA\mysqldatadir = D:\JAVA\mysql\dataport = 3306max_connections = 20character-set-server = utf8# Remove leading # to set options mainly useful for reporting servers.# The server defaults are faster for transactions and fast SELECTs.# Adjust sizes as needed, experiment to find the optimal values.# join_buffer_size = 128M# sort_buffer_size = 2M# read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
如下图所示:

上图可见,mysql没有data目录,接下来我们需要初始化data目录

cmd下进入bin目录

4、运行:mysqld --initialize

5、安装mysql   mysqld install mysql --defaults-file="D:\JAVA\mysql\my.ini"

6、启动mysql net start mysql

后记:

在初始化时如果加上 –initial-insecure,则会创建空密码的 root@localhost 账号,否则会创建带密码的 root@localhost 账号

密码保存在:data文件夹下的*.err文件中

:2016-11-25T04:05:29.713660Z 1 [Note] A temporary password is generated for root@localhost: /lSEqHkou0x%

转载于:https://www.cnblogs.com/lgh1992314/p/6616289.html

你可能感兴趣的文章
HTML5:离线存储(缓存机制)-IndexDB
查看>>
9-5
查看>>
Redis存储AccessToken
查看>>
Use commons-email-1.1.jar+activation.jar+mail.jar to send Email
查看>>
iOS 开发常见函数
查看>>
Android: NDK编程入门笔记
查看>>
深刻理解Linux进程间通信(IPC)
查看>>
windows 7中添加新硬件的两种方法(本地回环网卡)
查看>>
javascript 高级程序设计学习笔记(面向对象的程序设计) 2
查看>>
支配集,点覆盖集,点独立集之间的联系
查看>>
SetCapture ReleaseCapture
查看>>
DataGridView ——管理员对用户的那点操作
查看>>
POJ - 1185 炮兵阵地 (状态压缩)
查看>>
ios7 JavaScriptCore.framework
查看>>
算法6-5:哈希表应用之集合
查看>>
压力单位MPa、Psi和bar之间换算公式
查看>>
Moscow Pre-Finals Workshop 2016. National Taiwan U Selection
查看>>
程序员面试、算法研究、编程艺术、红黑树4大系列集锦与总结 .
查看>>
idea tomcat 配置
查看>>
冲刺第二天
查看>>