win10 64位安装mysql 5.6.40

MySQL安装

  1. 下载mysql:https://dev.mysql.com/downloads/mysql/

mysql下载
mysql下载2

2.下载后解压;(F:mysql-5.6.40-winx64)

3.配置环境变量:

在·我的电脑·-->属性-->高级系统选项-->高级-->环境变量 中配置;

配置mysql环境变量

直接在·系统变量·下的 path 中添加 F:\mysql-5.6.40-winx64/bin

添加mysql环境变量

  1. 启动mysql服务
C:\Users\APKDEV>f:                           #进入f盘
F:\>cd mysql-5.6.40-winx64\bin                #进入mysql的bin目录
F:\mysql-5.6.40-winx64\bin>net start mysql    #启动服务
    服务名无效。
    请键入 NET HELPMSG 2185 以获得更多的帮助。
F:\mysql-5.6.40-winx64\bin>  

此时发现提示 服务名无效;
运行:mysqld -install

F:\mysql-5.6.40-winx64\bin>mysqld --install
Service successfully installed. 

若提示Install/Remove of the Service Denied!,关闭cmd以管理员模式打开即可:

F:\mysql-5.6.40-winx64\bin>mysqld -install
Install/Remove of the Service Denied!
  1. 在重新运行net start mysql即可:
F:\mysql-5.6.40-winx64\bin>net start mysql
MySQL 服务正在启动 ...
MySQL 服务已经启动成功。 
  1. 登录mysql(刚安装的mysql默认账号为 root 密码为空)
F:\mysql-5.6.40-winx64\bin>mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.40 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, 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> 

5.设置/更改密码

mysql> update mysql.user set authentication_string=password("123456") where user
="root";   #password("123456"),此处引号中的内容是密码,自己可以随便设置
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1
mysql> flush privileges;  #作用:相当于保存,执行此命令后,设置才生效,若不执行,还是之前的密码不变
Query OK, 0 rows affected (0.01 sec)

6.退出

mysql> quit
Bye

Larwas
请先登录后发表评论
  • 最新评论
  • 总共0条评论