mysql 5.7.13 安装配置方法图文教程_Mysql_脚本之家

作者:数据库    发布时间:2019-12-21 21:12     浏览次数 :

[返回]

本文实例为大家分享了mysql 5.7.13 winx64安装配置方法图文教程,供大家参考,具体内容如下

最近决定学习数据库,在比较了各个数据库之后,选择从mysql入手,主要原因:•开源•成熟,通用•用户量多,社区完善•入门简单

下载MySQL程序,您可以从MySQL官网上下载,或者点击这里下载 解压mysql-5.7.13-winx64.zip文件到你想安装的目录,我的例子是 D:programmysql-5.7.13-winx64。其中的目录结构如下: 文件夹:bin docs include lib share 文件: COPYING README my-default.ini 拷贝文件 my-default.ini 到相同目录下重命名为my.ini。 E盘新建一个mysqlData文件夹。 在my.ini里面内容清空,重新复制成一下内容。

一、下载安装mysql的官网下载地址: Download,也是官网的推荐版本)和解压缩版本。我这里选择的是解压缩版本,点击download进行下载,下载完毕后直接将压缩包解压到您想要安装mysql的目标路径即可。我下载的是5.7.13版本,解压后,得到一个mysql-5.7.13-winx64的文件夹,它包含如下文件:2016/07/18 14:34

[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:programmysql-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

.2016/07/18 14:34

同过cd 命令进入到mysql目录下的bin文件夹下。 执行安装mysql服务的命令:

..2016/07/18 14:34

mysqld --install MySQL --defaults-file=D:programmysql-5.7.13-winx64my.ini

bin2016/05/25 13:50 17,987 COPYING2016/07/18 14:34

安装成功后提示:Service successfully installed

docs2016/07/18 14:33

为了生成data目录及初始化数据,执行以下命令:

include2016/07/18 14:34

mysqld --initialize

lib2016/05/25 14:08 1,141 my-default.ini2016/05/25 13:50 2,478 README2016/07/18 14:34

这个命令执行完之后,就会在上文新建的 E:mysqlData 文件夹里面生成MySQL需要用到的文件和文件夹。

share 3 个文件 21,606 字节 7 个目录 118,994,726,912 可用字节

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

至此,下载安装完毕

在 E:mysqlData 文件夹里面的mysql_error_log文件里找到下面这一行:

二、配置mysql

复制代码 代码如下:2016-08-02T23:09:18.827488Z 1 [Note] A temporary password is generated for root@localhost: #98um:=-RfbI

1.配置my.ini我这里将mysql-5.7.13-winx64文件重命名为mysql,该文件下的my-default.ini是默认的配置文件,我们这里需要自己重新实现配置:将my-default.ini复制一份并重命名为my.ini,并将最将basedir、datadir等参数的文件目录替换成你自己mysql所在目录的路径。

临时密码是 root@localhost: 后面的#98um:=-RfbI。

 # 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 = C:mysqldatadir = C:mysqldata# port = .....# server_id = .....# 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 = 2Msql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
下一篇:没有了