Heim  >  Artikel  >  Datenbank  >  MySql5.7.14安装教程详解(解压版)_MySQL

MySql5.7.14安装教程详解(解压版)_MySQL

WBOY
WBOYOriginal
2016-09-09 08:13:421060Durchsuche

下面进入正式的教程:

第一步:下载最近的MySQL文件并且解压:

下载最新版的MySQL–mysql-5.7.12下载地址

将下载到的文件解压缩到自己喜欢的位置,例如我自己的位置是D:\MySQL\mysql-5.7.12-winx64

第二步:配置环境变量

这里不多说,bin目录配置到path下面就行了。

第三步:添加配置文件

直接复制一个解压路径下面的 my-default.ini文件,重命名为my.ini然后编辑该文件,内容如下:

<code class="hljs tex has-numbering" style="display: block; padding: 0px; color: inherit; box-sizing: border-box; font-family: "Source Code Pro", monospace;font-size:undefined; white-space: pre; border-radius: 0px; word-wrap: normal; background: transparent;">
<span class="hljs-special" style="box-sizing: border-box; color: rgb(102, 102, 0);">[</span>mysqld<span class="hljs-special" style="box-sizing: border-box; color: rgb(102, 102, 0);">]
</span> 
basedir=D:<span class="hljs-command" style="box-sizing: border-box; color: rgb(0, 0, 136);">\MySQL</span><span class="hljs-command" style="box-sizing: border-box; color: rgb(0, 0, 136);">\mysql</span>-5.7.12-winx64<span class="hljs-command" style="box-sizing: border-box; color: rgb(0, 0, 136);">\ </span>datadir=D:<span class="hljs-command" style="box-sizing: border-box; color: rgb(0, 0, 136);">\MySQL</span><span class="hljs-command" style="box-sizing: border-box; color: rgb(0, 0, 136);">\mysql</span>-5.7.12-winx64<span class="hljs-command" style="box-sizing: border-box; color: rgb(0, 0, 136);">\data</span><span class="hljs-command" style="box-sizing: border-box; color: rgb(0, 0, 136);">\ </span>port=3306</code><ul class="pre-numbering" style="box-sizing: border-box; position: absolute; width: 50px; top: 0px; left: 0px; margin: 0px; padding: 6px 0px 40px; border-right: 1px solid rgb(221, 221, 221); list-style: none; text-align: right; background-color: rgb(238, 238, 238);"><li style="box-sizing: border-box; padding: 0px 5px;">1</li>
<li style="box-sizing: border-box; padding: 0px 5px;">2</li>
<li style="box-sizing: border-box; padding: 0px 5px;">3</li>
<li style="box-sizing: border-box; padding: 0px 5px;">4</li>
</ul>

这里需要注意的主要有两个问题:

1、basedir是上面的你的mysql文件的解压路径。

2、在该路径下面新建一个名为data的空文件夹,就是datadir。

第四步:初始化数据库并且配置服务

在做这一步之前,一定要注意两个问题!!!切记!!!

第一: 以管理员自身份打开CMD;

第二:用cd命令进入到你MySQL文件的解压路径!

然后执行 mysqld --initialize --user=mysql --console

执行成功之后,在打印的文字的最后面是数据库的初始密码,记得要拷贝下来,用鼠标选中,回车一下找个地方ctrl+v就行了。

上面弄完之后,再管理员自身份打开CMD执行

mysqld --install MySQL –>添加到系统服务 
net start mysql –>启动mysql服务

第五步:修改mysql的初始密码

1、打开CMD执行 : mysql -u root -p

2、输入你刚才保存的数据库的初始密码。

3、执行 set password = password(‘***NewPassword***‘);

NewPassword的位置输入你自己的新密码就行了。

以上所述是小编给大家介绍的MySql5.7.14安装教程详解(解压版),希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn