从零开始搭建Java开发环境第二篇:如何在windows…

2019-09-02 09:45:35来源:博客园 阅读 ()

新老客户大回馈,云服务器低至5折

从零开始搭建Java开发环境第二篇:如何在windows10里安装MySQL

1 下载安装包

1.1 压缩包

https://dev.mysql.com/downloads/mysql/

[外链图片转存失败(img-oesO8K09-1566652568838)(data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动")]

1.2 安装包

使用安装包安装则无需后续步骤

https://dev.mysql.com/downloads/file/?id=488055

[外链图片转存失败(img-Y3x59iO4-1566652568839)(data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动")]

2 配置环境变量

[外链图片转存失败(img-RBgnyR9U-1566652568840)(data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动")]

3 初始化MySQL

[外链图片转存失败(img-pVrsH1g4-1566652568841)(data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动")]

在MySQL路径下输入命令mysqld --initialize --user=mysql --console

[外链图片转存失败(img-4a4YX8nO-1566652568842)(data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动")]

3.1 记住你的初始密码

[外链图片转存失败(img-IQFQj1kT-1566652568842)(data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动")]

2019-08-24T11:55:10.299750Z 0 [System] [MY-013169] [Server] F:\DEV\env\mysql-8.0.17-winx64\bin\mysqld.exe (mysqld 8.0.17) initializing of server in progress as process 27232 2019-08-24T11:55:10.355861Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. 2019-08-24T11:55:33.531673Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: k;k;w6OJEZ#Q

2019-08-24T11:55:45.353166Z 0 [System] [MY-013170] [Server] F:\DEV\env\mysql-8.0.17-winx64\bin\mysqld.exe (mysqld 8.0.17) initializing of server has completed

4 启动服务

[外链图片转存失败(img-LVA4VR9p-1566652568842)(data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw== "点击并拖拽以移动")]

  • 接着就是输入mysqld -install进行服务的添加
  • 输入net start mysql启动服务
  • 输入mysql -u root -p进行登录数据库,这时提示需要密码,然后就是用你上面的密码登录
  • 修改密码语句:ALTER USER root@localhost IDENTIFIED BY '123456'; 修改密码为:123456

如果控制台乱码,可以改编码为utf-8

如果用git bash遇到问题,可以使用Windows自带的cmd或者powershell

在这里插入图片描述


原文链接:https://www.cnblogs.com/xll1025/p/11443983.html
如有疑问请与原作者联系

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:Object 类

下一篇:如何成为更好的程序员?