首页 > 数据库 > MySQL > 正文

mysql 5.7.13 安装配置方法图文教程(win10 64位)

2024-07-24 12:52:35
字体:
来源:转载
供稿:网友

本文实例为大家分享了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需要用到的文件和文件夹。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表