MySQL安装
目录
MySQL安装
本教程将介绍如何使用MySQL Installer在Windows平台(Win10)上安装MySQL。在学习并按照本教程所示的步骤操作之后,您将有一个MySQL数据库服务器在您的系统中,并以此MySQL数据库服务器为基础,运行相关工具来学习和实践MySQL。
下载MySQL安装程序
这里想要说的是,安装MySQL的方式有好几种,由于文章篇幅的限制,这里只选定一种作为安装演示。具体的安装,可以按照你喜欢的方式来。只要有两种方式:
- 在线安装版,下载:mysql-installer-web-community.exe
- 离线安装版,下载:mysql-installer-community.exe
- 解压缩版,下载:Windows (x86, 64-bit), ZIP Archive
上面的下载安装程序,可以从网址: http://dev.mysql.com/downloads/mysql/ 找到。
如果要在Windows环境中安装MySQL,使用MySQL安装程序是最简单的方法。MySQL安装程序为您提供了一个易于使用的向导,可帮助您使用以下组件安装MySQL:
- MySQL服务器
- 所有可用连接器
- 具有示例数据模型的MySQL Workbench
- MySQL通知程序
- Excel和Microsoft Visual Studio的工具
- MySQL示例数据库
- MySQL文档
现在,我们一步步来看,如何下载并安装 MySQL 服务器软件。
第一步:下载所需的安装包
打开网址:http://dev.mysql.com/downloads/mysql/ , 如下所示 –
注:因为在编写本教程时,使用的是Win10 64位的操作系统,所以这里选择:Windows (x86, 64-bit), ZIP Archive 下载
在弹出的第二个页面中,选择点击“No thanks, just start my download.” 跳过注册/登录帐号环节直接下载。如下图所示 –
然后,耐心等待下载完成…
第二步:压缩到指定目录
准备好一个安装 MySQL 程序的目录,如:D:/software
在本教程中,您已经学会了如何使用MySQL安装程序在Windows系统中安装MySQL,下载MySQL示例数据库并将其加载到MySQL服务器中,以通过此MySQL教程练习和学习MySQL。
这里解压后的目录为:D:\software\mysql-5.7.18-winx64 , 此目录下的文件如下所示 –
第三步:启动MySQL服务器
以管理员身份打开命令行,进入 MySQL 服务器安装的目录:D:\software\mysql-5.7.18-winx64\bin ,执行以下命令启动 MySQL –
Microsoft Windows [版本 10.0.10586]
(c) 2015 Microsoft Corporation。保留所有权利。
C:\WINDOWS\system32>D:
D:\>cd software\mysql-5.7.18-winx64\bin
D:\software\mysql-5.7.18-winx64\bin>mysqld -install
Service successfully installed.
D:\software\mysql-5.7.18-winx64\bin>net start mysql
MySQL 服务正在启动 ..
MySQL 服务已经启动成功。
D:\software\mysql-5.7.18-winx64\bin>
如果有提示如下错误 –
D:\software\mysql-5.7.18-winx64\bin> mysqld.exe
mysqld: Can't change dir to 'D:\software\mysql-5.7.18-winx64\data' (Errcode: 2 - No such file or directory)
2017-07-14T18:48:51.023897Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
... ...
2017-07-14T18:48:51.039516Z 0 [Note] Binlog end
2017-07-14T18:48:51.039516Z 0 [Note] mysqld.exe: Shutdown complete
上面错误提示中,已经说明了:
mysqld: Can't change dir to 'D:\software\mysql-5.7.18-winx64\data' (Errcode: 2 - No such file or directory)
则需要在创建一个目录:D:\software\mysql-5.7.18-winx64\data\ ,现在我们就来创建这个目录,在创建目录完成后重新执行 mysqld -install
启动 MySQL 服务器 –
一定要注意两个问题,切记!
第一: 以管理员自身份打开CMD;
第二:用cd命令进入到你MySQL文件的解压路径。
第四步:连接MySQL服务器
服务启动成功之后,就可以连接/登录MySQL服务器了,打开命令提交符界面输入mysql -u root -p
或 mysql -h localhost -u root -p
(第一次登录没有密码,直接按回车过),登录成功,但是登录成功后,不能执行任何操作,MySQL服务器要求您必须设置密码再执行其它操作。
假设我们登录成功后,要查看当前目录下所数据名称(执行查询:show databases
),但它提示要先设置密码。完整的过程如下所示 –
D:\software\mysql-5.7.18-winx64\bin>mysql -hlocalhost -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.9
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.08 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
6 rows in set (0.11 sec)
mysql>
有关解压包安装MySQl服务器就这样完成了~,如果想要使用在线安装的方式来安装MySQL,请参考: http://dev.mysql.com/doc/refman/5.7/en/mysql-installer.html
或者,如果您觉得安装过程比较烦锁,那么可以使用以下在线环境。
MySQL在线环境(免安装)
Mysql是最流行的关系型数据库管理系统,在WEB应用方面MySQL是最好的RDBMS(Relational Database Management System:关系数据库管理系统)应用软件之一。具有免费开源、跨平台、支持多种语言、支持千万级大型记录等特点。下面我将向你介绍如何在 CloudStudio 平台上运行MySql服务,以最小的成本搭建一个MySql数据库。
CloudStudio 在 PHP 开发环境中为我们集成了一个MySql5.7.12的服务端程序,使用起来也非常简单。下面我将叫你如何启动运行它:
- step1:访问CloudStudio,注册/登录账户。
- step2:在右侧的运行环境菜单选择:
"PHP"
运行环境 - step3:通过命令:
sudo /etc/init.d/mysql start
启动MySql服务 - step4:通过命令:
mysql -hlocalhost -uroot -p
可以登录mysql服务端,默认密码是coding(我承认我是蒙对的)。
至此,一个Mysql的服务便启动了!它的配置文件的位置是:/etc/mysql/mysql.conf.d/mysqld.cnf 你可以自己去更改配置。
移动端:请扫描本页面底部(右侧)二维码并关注微信公众号,回复:”教程” 选择相关教程阅读
order lexapro 20mg naltrexone brand where can i buy revia
lasix pills purchase acticlate for sale order albuterol pills
brand strattera sertraline 50mg for sale zoloft sale
urso 150mg cost generic actigall cetirizine 10mg uk
how to buy zithromax omnacortil 40mg price cheap neurontin generic
best natural supplements for gerd stomach upset from taking medication best otc med for flatulence
brand deltasone 40mg prednisone over the counter amoxil us
get birth control prescribed online cheapest birth control online how to increase sperm count by food
buy cheap generic promethazine phenergan canada stromectol online canada
best antacid for stomach ulcer class ic antiarrhythmics drugs will tylenol help ease uti pain
buy duloxetine 20mg sale order provigil 200mg generic purchase modafinil online
vitamins that kill fungus list of medication for hypertension combination blood pressure medications list
can you get valtrex online how is type 2 diagnosed how is type 2 diabetes diagnosed
buy generic cyproheptadine buy periactin pill ketoconazole over the counter
prescription drug for stopping smoking dangers of osteoporosis medications strong prescribed pain killers
buy medroxyprogesterone pills for sale cost medroxyprogesterone hydrochlorothiazide online
most potent sleeping pills prescription diet pills without doctor get prescription diet pills online
order femara 2.5mg pills buy generic albendazole 400mg cheap aripiprazole 20mg
alfuzosin 10 mg cost homeopathic medicine for stomach acid heartburn relief without calcium
buy minocycline medication minocin 100mg cost buy ropinirole for sale
strongest topical body acne medication teenage acne treatments that work buy oxcarbazepine pills
catapres 0.1mg over the counter spiriva 9 mcg ca spiriva 9 mcg oral
calcitriol 0.25mg tablet buy calcitriol 0.25 mg for sale order tricor 160mg sale
trimox order arimidex 1mg sale biaxin drug
essay edit free slots casino games best play money poker sites
online assignment help reflective essay writing 101 suprax 100mg ca
aspirin 75mg price legit real money online casinos free casino games no registration no download
lamisil cost casino money poker online for real money
oral desyrel 50mg desyrel 100mg uk clindamycin drug
axetil us cheap ceftin 500mg buy robaxin online cheap
tadacip drug diclofenac 50mg over the counter purchase indomethacin pills
tamoxifen pills buy tamoxifen cheap budesonide drug
retin for sale tretinoin for sale stendra pill
buy generic cleocin order fildena 50mg pills fildena 100mg tablet
lamictal over the counter nemazole over the counter buy vermox for sale
metronidazole 400mg oral keflex generic buy keflex 250mg generic
buy aurogra online cheap purchase estradiol sale buy estrace 1mg without prescription
order diflucan 100mg brand ciprofloxacin 500mg order baycip online
aldactone pills spironolactone where to buy buy propecia 5mg pills
good academic writing academic writing uk buy an essay online cheap
oral domperidone 10mg order motilium 10mg generic buy tetracycline 500mg sale
buy ranitidine buy celecoxib 100mg online celebrex uk
buspirone 5mg drug buy generic amiodarone 200mg buy cordarone medication
sumatriptan oral sumatriptan buy online buy avodart cheap
buy generic zyloprim over the counter rosuvastatin 10mg cheap order crestor 20mg
oral nexium 20mg topamax 100mg uk topiramate 100mg uk
purchase astelin generic avalide online buy irbesartan sale
cheap famotidine 20mg order pepcid 40mg for sale order tacrolimus 1mg
buy generic warfarin paxil 20mg generic metoclopramide 10mg brand
buy xenical pill purchase xenical pill diltiazem online order
nortriptyline order online order pamelor 25 mg generic panadol sale
buy glimepiride medication misoprostol online buy arcoxia 60mg tablet
where to buy propranolol without a prescription buy clopidogrel 150mg generic plavix over the counter
buy alendronate generic order nitrofurantoin 100mg online cheap purchase furadantin pill
buy generic ozobax over the counter buy generic baclofen order toradol 10mg online
order claritin 10mg generic priligy 90mg pill priligy drug
buy generic lioresal online buy cheap lioresal purchase toradol sale
phenytoin 100 mg tablet oxybutynin sale order ditropan 2.5mg online cheap
coversyl uk fexofenadine 180mg usa cheap allegra
levitra 20mg pill buy generic vardenafil for sale zanaflex us
buy medrol us aristocort 10mg over the counter aristocort generic
serophene tablet isosorbide canada azathioprine 50mg price
casino slots free brand levothyroxine levothroid over the counter
symmetrel ca order atenolol 100mg generic oral avlosulfon
play poker online free no sign up play online blackjack ivermectin 2mg online
hollywood casino live dealer blackjack albuterol online
pantoprazole oral lisinopril generic buy pyridium no prescription
best casino online no deposit bonus codes lasix 100mg pills
azithromycin pills neurontin 800mg cost neurontin 600mg uk
lipitor uk amlodipine 5mg ca order amlodipine 5mg pill
buy accutane pill order azithromycin for sale order azithromycin 500mg sale
buy cefdinir 300mg order omnicef sale lansoprazole 15mg pills
provigil medication order promethazine 25mg generic buy deltasone for sale
purchase cenforce buy cenforce sale purchase chloroquine pill
cialis price real viagra 100mg sildenafil 50mg oral
micardis price movfor cheap brand molnunat
prilosec cost buy montelukast 10mg without prescription metoprolol over the counter
premarin 0.625mg without prescription buy generic premarin online oral sildenafil 50mg
xalatan uk buy capecitabine 500 mg sale exelon ca
order vasotec 5mg sale lactulose oral purchase duphalac without prescription
mestinon 60 mg uk maxalt online buy order maxalt online cheap
purchase ferrous sulfate online cheap purchase actonel online buy sotalol generic
monograph 600 mg cheap colospa 135mg us order cilostazol online cheap
order prasugrel 10mg order dramamine 50mg detrol pills
buy florinef pills buy aciphex medication buy generic imodium
brand dydrogesterone purchase dydrogesterone for sale empagliflozin where to buy
order melatonin 3 mg generic buy melatonin online buy danazol sale
buy generic dipyridamole for sale order pravastatin sale pravastatin 20mg over the counter
aspirin order online oral imiquad buy imiquimod for sale
buy acarbose 50mg without prescription repaglinide 1mg drug pill fulvicin 250 mg
buy minoxidil without a prescription buy cheap generic minoxytop herbal ed pills
cialis 10mg without prescription buy cialis 40mg sale viagra 50mg drug
ketotifen 1 mg ca buy zaditor 1 mg generic buy generic tofranil
where can i buy tricor buy fenofibrate online order tricor generic