首页

文章

windows下怎么安装mysql

发布网友 发布时间:2022-04-19 20:58

我来回答

4个回答

热心网友 时间:2022-04-07 22:19

步骤/方法1
打开下载的安装文件,出现如下界面:

2
mysql安装向导启动,点击“next”继续。

3
选择安装类型,有“Typical(默认)”、“Complete(完全)”、“Custom(用户自定义)”三个选项,我们选择“Custom”,有更多的选项,也方便熟悉安装过程。

4
在“MySQL Server(MySQL服务器)”上左键单击,选择“This feature, and all subfeatures, will be installed on local hard drive.”,即“此部分,及下属子部分内容,全部安装在本地硬盘上”。点选“Change...”,手动指定安装目录。

5
确认一下先前的设置,如果有误,按“Back”返回重做。按“Install”开始安装。

6
正在安装中,请稍候,直到出现下面的界面。

7
点击“next”继续,出现如下界面。

8
现在软件安装完成了,出现上面的界面,这里有一个很好的功能,mysql 配置向导,不用向以前一样,自己手*七八糟的配置my.ini 了,将“Configure the Mysql Server now”前面的勾打上,点“Finish”结束软件的安装并启动mysql配置向导。
9
点击“Finsh”,出现如下界面,MySQL Server配置向导启动。

10
点击“next”出现如下界面:

选择配置方式,“Detailed Configuration(手动精确配置)”、“Standard Configuration(标准配置)”,我们选择“Detailed Configuration”,方便熟悉配置过程。

选择服务器类型,“Developer Machine(开发测试类,mysql 占用很少资源)”、“Server Machine(服务器类型,mysql占用较多资源)”、“Dedicated MySQL Server Machine(专门的数据库服务器,mysql占用所有可用资源)”,大家根据自己的类型选择了,一般选“Server Machine”,不会太少,也不会占满。

选择mysql数据库的大致用途,“Multifunctional Database(通用多功能型,好)”、“Transactional Database Only(服务器类型,专注于事务处理,一般)”、“Non-Transactional Database Only(非事务处理型,较简单,主要做一些监控、记数用,对MyISAM数据类型的支持仅限于non-transactional),随自己的用途而选择了,我这里选择“Transactional Database Only”,按“Next”继续。

对InnoDB Tablespace进行配置,就是为InnoDB 数据库文件选择一个存储空间,如果修改了,要记住位置,重装的时候要选择一样的地方,否则可能会造成数据库损坏,当然,对数据库做个备份就没问题了,这里不详述。我这里没有修改,使用默认位置,直接按“Next”继续。

选择您的网站的一般mysql 访问量,同时连接的数目,“Decision Support(DSS)/OLAP(20个左右)”、“Online Transaction Processing(OLTP)(500个左右)”、“Manual Setting(手动设置,自己输一个数)”,我这里选“Online Transaction Processing(OLTP)”,自己的服务器,应该够用了,按“Next”继续。

是否启用TCP/IP连接,设定端口,如果不启用,就只能在自己的机器上访问mysql 数据库了,我这里启用,把前面的勾打上,Port Number:3306,在这个页面上,您还可以选择“启用标准模式”Enable Strict Mode),这样MySQL就不会允许细小的语法错误。如果您还是个新手,我建议您取消标准模式以减少麻烦。但熟悉MySQL以后,尽量使用标准模式,因为它可以降低有害数据进入数据库的可能性。还有一个关于防火墙的设置“Add firewall exception ……”需要选中,将MYSQL服务的监听端口加为windows防火墙例外,避免防火墙阻断。按“Next”继续。

注意:如果要用原来数据库的数据,最好能确定原来数据库用的是什么编码,如果这里设置的编码和原来数据库数据的编码不一致,在使用的时候可能会出现乱码。这个比较重要,就是对mysql默认数据库语言编码进行设置,第一个是西文编码,第二个是多字节的通用utf8编码,都不是我们通用的编码,这里选择第三个,然后在Character Set 那里选择或填入“gbk”,当然也可以用“gb2312”,区别就是gbk的字库容量大,包括了gb

热心网友 时间:2022-04-07 23:37

1、 MySQL Community Server 5.6.10

官方网站下载mysql-5.6.10-winx64.zip
2、解压到d:\MySQL.(路径自己指定)
3、在d:\MySQL下新建my.ini配置文件,内容如下:

*****************配置文件开始*********************

# MySQL Server Instance Configuration File
#----------------------------------------------------------------------
# Generated by the MySQL Server Instance ConfigurationWizard
#
#
# Installation Instructions
#----------------------------------------------------------------------
#
#
# CLIENT SECTION
#----------------------------------------------------------------------
#
# The following options will be read by MySQL clientapplications.
# Note that only client applications shipped by MySQLare guaranteed
# to read this section. If you want your own MySQLclient program to
# honor these values, you need to specify it as anoption ring the
# MySQL client library initialization.
#
[client]

port=3306

[mysql]

default-character-set=gbk

# SERVER SECTION
#----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server.Make sure that
# you have installed the server correctly (see above)so it reads this
# file.
#
[mysqld]

# The TCP/IP Port the MySQL Server will listen on
port=3306

#Path to installation directory. All paths are usuallyresolved relative to this.
basedir="d:\MySQL\"
#Path to the database root
datadir="d:\MySQL\Data"
[WinMySQLadmin]
Server="d:\MySQL\bin\mysqld.exe"

# The default character set that will be used when anew schema or table is
# created and no character set is defined
default-character-set=gbk

# The default storage engine that will be used whencreate new tables when
default-storage-engine=INNODB

# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

# The maximum amount of concurrent sessions the MySQLserver will
# allow. One of these connections will be reserved fora user with
# SUPER privileges to allow the administrator to logineven if the
# connection limit has been reached.
max_connections=100

# Query cache is used to cache SELECT results andlater return them
# without actual executing the same query once again.Having the query
# cache enabled may result in significant speedimprovements, if your
# have a lot of identical queries and rarely changingtables. See the
# "Qcache_lowmem_prunes" status variable tocheck if the current value
# is high enough for your load.
# Note: In case your tables change very often or ifyour queries are
# textually different every time, the query cache mayresult in a
# slowdown instead of a performance improvement.
query_cache_size=0

# The number of open tables for all threads.Increasing this value
# increases the number of file descriptors that mysqldrequires.
# Therefore you have to make sure to set the amount ofopen files
# allowed to at least 4096 in the variable"open-files-limit" in
# section [mysqld_safe]
table_cache=256

# Maximum size for internal (in-memory) temporarytables. If a table
# grows larger than this value, it is automaticallyconverted to disk
# based table This limitation is for a single table.There can be many
# of them.
tmp_table_size=26M

# How many threads we should keep in a cache forreuse. When a client
# disconnects, the client's threads are put in thecache if there aren't
# more than thread_cache_size threads frombefore. This greatly reces
# the amount of thread creations needed if you have alot of new
# connections. (Normally this doesn't give a notableperformance
# improvement if you have a good threadimplementation.)
thread_cache_size=8

#*** MyISAM Specific options

# The maximum size of the temporary file MySQL isallowed to use while
# recreating the index (ring REPAIR, ALTER TABLE orLOAD DATA INFILE.
# If the file-size would be bigger than this, theindex will be created
# through the key cache (which is slower).
myisam_max_sort_file_size=100G

# If the temporary file used for fast index creationwould be bigger
# than using the key cache by the amount specifiedhere, then prefer the
# key cache method. This is mainly used to force long character keys in
# large tables to use the slower key cache method tocreate the index.
myisam_sort_buffer_size=52M

# Size of the Key Buffer, used to cache index blocksfor MyISAM tables.
# Do not set it larger than 30% of your available memory,as some memory
# is also required by the OS to cache rows. Even ifyou're not using
# MyISAM tables, you should still set it to 8-64M asit will also be
# used for internal temporary disk tables.
key_buffer_size=40M

# Size of the buffer used for doing full table scansof MyISAM tables.
# Allocated per thread, if a full scan is needed.
read_buffer_size=64K
read_rnd_buffer_size=256K

# This buffer is allocated when MySQL needs to rebuildthe index in
# REPAIR, OPTIMZE, ALTER table statements as well asin LOAD DATA INFILE
# into an empty table. It is allocated per thread sobe careful with
# large settings.
sort_buffer_size=256K

#*** INNODB Specific options ***
innodb_data_home_dir="d:\MySQL\Data\INNODB\"

# Use this option if you have a MySQL server withInnoDB support enabled
# but you do not plan to use it. This will save memoryand disk space
# and speed up some things.
#skip-innodb

# Additional memory pool that is used by InnoDB tostore metadata
# information. If InnoDB requires more memory for this purpose it will
# start to allocate it from the OS. As this is fast enough on most
# recent operating systems, you normally do not needto change this
# value. SHOW INNODB STATUS will display the currentamount used.
innodb_additional_mem_pool_size=2M

# If set to 1, InnoDB will flush (fsync) thetransaction logs to the
# disk at each commit, which offers full ACIDbehavior. If you are
# willing to compromise this safety, and you arerunning small
# transactions, you may set this to 0 or 2 to rece diskI/O to the
# logs. Value 0 means that the log is only written tothe log file and
# the log file flushed to disk approximately once persecond. Value 2
# means the log is written to the log file at eachcommit, but the log
# file is only flushed to disk approximately once persecond.
innodb_flush_log_at_trx_commit=1

# The size of the buffer InnoDB uses for buffering logdata. As soon as
# it is full, InnoDB will have to flush it to disk. Asit is flushed
# once per second anyway, it does not make sense tohave it very large
# (even with long transactions).
innodb_log_buffer_size=1M

# InnoDB, unlike MyISAM, uses a buffer pool to cacheboth indexes and
# row data. The bigger you set this the less disk I/Ois needed to
# access data in tables. On a dedicated databaseserver you may set this
# parameter up to 80% of the machine physical memorysize. Do not set it
# too large, though, because competition of thephysical memory may
# cause paging in the operating system. Note that on 32bit systems you
# might be limited to 2-3.5G of user level memory perprocess, so do not
# set it too high.
innodb_buffer_pool_size=77M

# Size of each log file in a log group. You should setthe combined size
# of log files to about 25%-100% of your buffer poolsize to avoid
# unneeded buffer pool flush activity on log fileoverwrite. However,
# note that a larger logfile size will increase thetime needed for the
# recovery process.
innodb_log_file_size=39M

# Number of threads allowed inside the InnoDB kernel.The optimal value
# depends highly on the application, hardware as wellas the OS
# scheler properties. A too high value may lead tothread thrashing.
innodb_thread_concurrency=8

*****************配置文件结束*********************

配置文件也放在了附件里,大家可以根据需要修改。

重点是以下配置,其中datadir的目录名称必须是data,并且好像必须是MySQL目录下的data.之前自己制定了其他目录,一直出现1067的错误。

#Path to installation directory. All paths are usuallyresolved relative to this.
basedir="d:\MySQL\"

#Path to the database root
datadir="d:\MySQL\Data"

4、在windows环境变量里加入以下内容(方便执行命令行命令)
新建MYSQL_HOME="d:\MySQL\"

在Path里加入%MYSQL_HOME%\bin

5、将mysql注册为windows系统服务。具体操作是在命令行中执行以下命令:
mysqld install MySQL --defaults-file="d:\MySQL\my.ini"

移除服务为 mysqld remove

6、第5步成功后,在命令行启动mysql
c:>net start mysql

7、修改root的密码为62386997
方法一:
c:>mysql –uroot
mysql>showdatabases;
mysql>use mysql;
mysql> UPDATE user SET password=PASSWORD("62386997") WHEREuser='root';
  mysql> FLUSH PRIVILEGES;
mysql> QUIT

方法二:
利用第三方管理工具Navicat8 for Mysql进行修改

热心网友 时间:2022-04-08 01:11

付费内容限时免费查看回答您好,先根据自己电脑的系统类型(64位或者32位),一般都是64位,打开下载的mysql安装文件双击解压缩,运行"mysql-5.5.40-win64.msi"或者"mysql-5.5.40-win32.msi"。点击Next

接着选择安装类型,有“Typical(默认)”、“Complete(完全)”、“Custom(用户自定义)”三个选项,我们选择选择“Custom”,按“next”键继续。

再建议先去除了C盘的盘,新建一个文件夹,命名为MySQL,选择“Browse”,手动指定安装目录。

选择安装文件夹

确认一下先前的设置,如果有误,点击“Back”返回重做。点击“Install”开始安装。

出现这个页面代表安装完成

热心网友 时间:2022-04-08 03:03

直接去下载安装包按步骤安装就行了,可以去搜索相应版本的安装教程
八月中国最凉快的地方 八月份哪里最凉快,去哪旅游好?美丽的地方 乱字同韵字是什么意思 华硕笔记本电脑触摸板怎么开笔记本电脑触摸板怎么开启和关闭_百度知 ... 陕西职务侵占案立案准则 结婚后我的恋情维系了十年,怎么做到的? 玉米仁子饭产自哪里 中国期货交易所的交易品种有哪些? 历史要怎么读,有啥诀窍 高中历史诀窍 年终会活动策划方案 深度解析:第一财经回放,探索财经新风向 逆水寒手游庄园怎么邀请好友同住 逆水寒手游 逆水寒不同区可以一起组队吗? 逆水寒手游 逆水寒怎么进入好友世界? 逆水寒手游 逆水寒怎么去别人的庄园? 使用puppeteer实现将htmll转成pdf 内卷时代下的前端技术-使用JavaScript在浏览器中生成PDF文档 【译】将HTML转为PDF的几种实现方案 变形金刚08动画怎么样 变形金刚08动画的问题 变形金刚08动画日语版剧情介绍 高分!换显卡nvidia控制面板被我卸了,重新安装显卡驱动后没了nvidia控... 我的nvidia控制面板被卸载了 怎么找回啊 卸载后 这个画面看着很奇怪_百 ... 李卓彬工作简历 林少明工作简历 广东工业职业技术学院怎么样 郑德涛任职简历 唐新桂个人简历 土地入股的定义 ups快递客服电话24小时 贷款记录在征信保留几年? 安徽徽商城有限公司公司简介 安徽省徽商集团新能源股份有限公司基本情况 安徽省徽商集团有限公司经营理念 2019哈尔滨煤气费怎么有税? 快手删除的作品如何恢复 体育理念体育理念 有关体育的格言和理念 什么是体育理念 万里挑一算彩礼还是见面礼 绿萝扦插多少天后发芽 绿萝扦插多久发芽 扦插绿萝多久发芽 炖牛排骨的做法和配料 网络诈骗定罪标准揭秘 “流水不争先”是什么意思? mc中钻石装备怎么做 为什么我的MC里的钻石块是这样的?我想要那种。是不是版本的问题?如果是... 带“偷儿”的诗句 win7怎么安装mysql数据库 mysql 5.7 zip 文件在 windows下的安装教程详解 windows7怎样安装mysql 滴滴快车等单是迅游好还是原地不动等好 现在燃油跑滴滴的话 是原地等单好还是边走边接单 师傅们,你们跑滴滴的时候是游走还是原地等 微子墓的微山微子墓 棠阴到微山湖岛怎么走 永成到微山湖有多远 中国五大淡水湖各是多少米 中国微山湖号综合补给舰的作战能力是怎样的? 微山湖是济宁部分比较漂亮还是枣庄漂亮啊?有人说... 微山湖湿地公园在什么位置? 微山湖有什么神话传说 纳木湖,太湖,鄱阳湖,微山湖,艾比湖 这几个湖的景色... 微山湖门票多少钱 微山湖的传说是什么? 安庄到微山湖有多少公里“ 微山湖国家湿地公园的介绍 微山湖的景色特点是什么 mysql在win7上怎么安装 如何安装mysql5.6.17 滴滴快车是在原地等单吗 脑洞大师把玩具从瓶子里拿出来怎么过? 脑洞大师200关怎么把水倒满? 脑洞大师106怎么从瓶子里把玩具拿出来? 508只能移动一根火柴最大数 脑洞大师第34关怎么过 第34关通关攻略 脑洞大师第29关怎么过 第29关通关攻略 脑洞大师第12怎样拿到包袱 308移动二根火柴最大数 脑洞有多大决定你能通攻略 脑洞大师攻略益血手术后左不能走路怎么办? 脑洞大师赶走幽灵这关怎么过 脑洞大师第57关通关方法 如何找到正确的规律 请教老滴滴司机们,你们在接单的时候是开着车吗?还是停下来接?城里可不准乱停车啊,怎么接好? 测海拔高度的手机软件下载 开快车在等单子的时候,你们一般是围着热力图转还是原地等待? 滴滴打车苦等30分钟无人接单,而司机却在家里蹲,到底是为什么? 怎样才能复制下来
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com