mysql 5.7.13 安装配置方法图文教程(win10 64位)
作者:zhangchao19890805 时间:2024-01-28 09:07:21
本文实例为大家分享了mysql 5.7.13 winx64安装配置方法图文教程,供大家参考,具体内容如下
(1) 下载MySQL程序,您可以从MySQL官网上下载,或者点击这里下载
(2) 解压mysql-5.7.13-winx64.zip文件到你想安装的目录,我的例子是
D:\program\mysql-5.7.13-winx64。其中的目录结构如下:
文件夹:bin docs include lib share
文件: COPYING README my-default.ini
(3) 拷贝文件 my-default.ini 到相同目录下重命名为my.ini。
(4) E盘新建一个mysqlData文件夹。
(5) 在my.ini里面内容清空,重新复制成一下内容。
[client]
no-beep
# pipe
# socket=mysql
port=3306
[mysql]
default-character-set=utf8
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/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]
explicit_defaults_for_timestamp = TRUE
# 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 = 2G
# 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\mysql-5.7.13-winx64\"
datadir="E:\mysqlData\"
port=3306
server_id=1
general-log=0
general_log_file="mysql_general.log"
slow-query-log=1
slow_query_log_file="mysql_slow_query.log"
long_query_time=10
log-error="mysql_error_log.err"
default-storage-engine=INNODB
max_connections=1024
query_cache_size=128M
key_buffer_size=128M
innodb_flush_log_at_trx_commit=1
innodb_thread_concurrency=128
innodb_autoextend_increment=128M
tmp_table_size=128M
# 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
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
character-set-server=utf8
innodb_flush_method=normal
(6) 管理员身份进入cmd(以下都是) 同过cd 命令进入到mysql目录下的bin文件夹下。
(7) 执行安装mysql服务的命令:
mysqld --install MySQL --defaults-file=D:\program\mysql-5.7.13-winx64\my.ini
安装成功后提示:Service successfully installed
(8) 为了生成data目录及初始化数据,执行以下命令:
mysqld --initialize
这个命令执行完之后,就会在上文新建的 E:\mysqlData 文件夹里面生成MySQL需要用到的文件和文件夹。
(9) E:\mysqlData 文件夹里面的文件结构如下:
文件夹: mysql、 performance_schema、 sys
文件: auto.cnf DESKTOP-SDK08IO.pid ib_buffer_pool ib_logfile0 ib_logfile1 ibdata1 ibtmp1 mysql_error_log.err mysql_slow_query.log
(10) 在 E:\mysqlData 文件夹里面的mysql_error_log文件里找到下面这一行:
2016-08-02T23:09:18.827488Z 1 [Note] A temporary password is generated for root@localhost: #98um:=-RfbI
临时密码是 root@localhost: 后面的#98um:=-RfbI。
(11) 同一个命令行程序里启动服务net start mysql 。
(12)新开一个命令后程序,进入 D:\program\mysql-5.7.13-winx64\bin 文件夹下,执行命令:
mysql -uroot -p
(13) 输入初始密码连接进入mysql数据库后,修改密码如下:
set password=password('123456');
flush privileges;
(14) 输入exit退出MySQL。
(15) 同一个命令后程序下,用新的密码进入mysql 执行命令:
mysql -uroot -p123456
进入MySQL后输入SQL:
select * from information_schema.TABLES t limit 3;
可以验证一下是否正常安装。
(16) 去MySQL官网下载安装Workbench,这样就可以使用MySQL的图像界面了。
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
女装类视觉设计分享
![](https://img.aspxhome.com/file/UploadPic/200910/30/1256637795938-73s.jpg)
Python详细讲解浅拷贝与深拷贝的使用
![](https://img.aspxhome.com/file/2023/5/81635_0s.png)
Python爬虫爬取ts碎片视频+验证码登录功能
![](https://img.aspxhome.com/file/2023/7/70207_0s.png)
PHP单例模式Singleton Pattern的原理与实现介绍
python通配符之glob模块的使用详解
javascript脚本控件topic
![](https://img.aspxhome.com/file/UploadPic/20109/1/icon_cry-53s.gif)
用vue.js组件模拟v-model指令实例方法
css基础教程之序曲
Python中实现输入超时及如何通过变量获取变量名
![](https://img.aspxhome.com/file/2023/5/105895_0s.jpg)
Python3中的真除和Floor除法用法分析
详解Python中的Dict(下篇)
![](https://img.aspxhome.com/file/2023/0/90920_0s.png)
数据清洗之如何用一行Python代码去掉文本中的各种符号
使用python和pygame绘制繁花曲线的方法
![](https://img.aspxhome.com/file/2023/8/103538_0s.png)
MySQL之xtrabackup备份恢复的实现
![](https://img.aspxhome.com/file/2023/7/109827_0s.png)
CSS教程:轻松解决表格的nobr问题
python实现简单倒计时功能
![](https://img.aspxhome.com/file/2023/5/75905_0s.jpg)
全兼容可高亮二级缓冲折叠菜单
![](https://img.aspxhome.com/file/UploadPic/20106/3/1-86s.gif)
Python利用Flask-Mail实现发送邮件详解
![](https://img.aspxhome.com/file/2023/8/115038_0s.png)
Python线程之同步机制实际应用场景举例说明
![](https://img.aspxhome.com/file/2023/0/76720_0s.png)
MySQL事务管理的作用详解
![](https://img.aspxhome.com/file/2023/7/89937_0s.png)