mysql5.7.10 zip windows安装
来源:互联网 发布:淘宝兄弟体育是正品么 编辑:程序博客网 时间:2024/05/18 01:33
从该网址下载mysql社区版http://dev.mysql.com/downloads/mysql/
将其解压到自己电脑的一个目录,例如笔者的目录为D:\Program Files\mysql-5.7.10-winx64
将该目录添加到系统的环境变量path中
在解压的目录之中复制my-default.ini的内容,新建一个文件,命名为my.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.
[mysql]
default-character-set=utf8
[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:/Program Files/mysql-5.7.10-winx64
datadir = D:/Program Files/mysql-5.7.10-winx64/data
port = 3306
# server_id = .....
character_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
[client]
port=3306
default-character-set=utf8
之后保存文件,打开cmd命令行窗口,注意已管理员身份运行,进入mysql的目录,即D:\Program Files\mysql-5.7.10-winx64
执行以下命令
mysqld -install
将mysql安装为服务
接着启动服务
net start mysql
此时出错
在网上查看资料,以及参考mysql官方文档点击打开链接,需要初始化手动初始化data文件夹
命令为
mysqld --initialize
之后再执行
net start mysql
服务顺利启动
之后需要修改root的密码
输入命令mysql -u root
报错 说 root@localhost 有密码,需要密码才能登录
问题出在了手动初始化data文件夹To initialize the data directory, invoke mysqld with the --initialize or --initialize-insecure option, depending on whether you want the server to generate a random initial password for the 'root'@'localhost' account.
官方 文档说
To initialize the data directory, invoke mysqld with the --initialize or --initialize-insecure option, depending on whether you want the server to generate a random initial password for the 'root'@'localhost' account.
Regardless of platform, use --initialize for “secure by default” installation (that is, including generation of a random initial root password). In this case, the password is marked as expired and you will need to choose a new one. With the --initialize-insecure option, no root password is generated; it is assumed that you will assign a password to the account in timely fashion before putting the server into production use.
大概意思是采用 --initialize 和 --initialize-insecure两种方式生成data文件夹,但是--initalize会随机生成一个密码分配给root@localhost,而--initialize-insecure不会生成密码,我使用了--initialize,继续查看文档
Connect to the server:
If you used --initialize but not --initialize-insecure to initialize the data directory, connect to the server as root using the random password that the server generated during the initialization sequence:
shell> mysql -u root -p
Enter password: (enter the random root password here)
Look in the server error log if you do not know this password.
If you used --initialize-insecure to initialize the data directory, connect to the server as root without a password:
shell> mysql -u root --skip-password
可以在error日志文件中找到,到D:\Program Files\mysql-5.7.10-winx64中的data文件夹下,发现一个以自己计算机名称为名,以.err为后缀的文件,打开
发现在第8行有一个临时密码被生成为47rhFKYdyC/k
重新登录
mysql -u root -p
输入密码 47rhFKYdyC/k
顺利登录
修改root密码
set password for root@localhost password("新密码")
或者采用命令
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';修改命令
即可
- mysql5.7.10 zip windows安装
- MYSQL5.7.10 ZIP安装
- mysql5.7 zip windows下安装
- windows安装mysql5.7zip版方法
- MySql5.7 zip windows安装教程
- mysql5.7.13.zip安装(windows)
- MYSQL5.6 ZIP安装
- MySQL5.5 zip 在Windows下的安装
- 关于MYSQL5.7.17zip安装
- mysql5.7.13-win64.zip安装
- Mysql5.7.18Zip安装配置
- mysql5.7.20-winx64.zip安装
- mysql5.7.20-winx64.zip安装
- MySQL5.7.12 Windows zip配置启动
- Windows下,MySQL5.6.x 免安装版(*.zip)的配置
- Windows下MySQL5.7.10免安装配置
- mysql5.6.25的zip格式安装配置
- 安装mysql5.7.11zip方法总结
- Hbuilder连接模拟器调试
- 观《恶棍天使》后感
- 行编辑程序
- 算法设计题2.38-线性表-第2章-《数据结构习题集》-严蔚敏吴伟民版
- 2015年北京师范大学新生程序设计竞赛题解
- mysql5.7.10 zip windows安装
- C++抽象类
- LT29i刷机方法
- 算法设计题2.39~2.40-线性表-第2章-《数据结构习题集》-严蔚敏吴伟民版
- THREEJS阴影效果
- 递归之---汉诺塔
- 【Light】[1078]Integer Divisibility
- Pillow-PIL的完全Fok替代库--完美解决报错The _imagingft C module is not installed的解决方案
- MyBatis学习总结(一)——MyBatis快速入门(转发)