windows10 安装 MySQL8.0.13 并启动,亲测完美!

1、官网下载https://dev.mysql.com/downloads/windows/installer/解压到 文件D:\database\mysql-8.0.13-winx64

 2、在D:\database\mysql-8.0.13-winx64新建my-default.ini文件

 

[mysqld]
# 设置3308端口
port=3308
# 设置mysql的安装目录
basedir=D:\database\mysql-8.0.13-winx64
# 设置mysql数据库的数据的存放目录
datadir=D:\database\mysql-8.0.13-winx64\data

#tmpdir=D:\database\mysql-8.0.13-winx64\temp
# 允许最大连接数
max_connections=200
# 允许连接失败的次数。
max_connect_errors=10
# 服务端使用的字符集默认为UTF8
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
# 默认使用“mysql_native_password”插件认证
#mysql_native_password
default_authentication_plugin=mysql_native_password
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[client]
# 设置mysql客户端连接服务端时默认使用的端口
port=3308
default-character-set=utf8

3、已管理员方式打开CMD窗口,初始化数据库,这里一定要用全路径方式,

D:\database\mysql-8.0.13-winx64\bin>D:\database\mysql-8.0.13-winx64\bin\mysqld.exe --initialize-insecure

D:\database\mysql-8.0.13-winx64\bin>D:\database\mysql-8.0.13-winx64\bin\mysqld.exe --install MySQL3308 --defaults-file=D:\database\mysql-8.0.13-winx64\my-default.ini
Service successfully installed.

D:\database\mysql-8.0.13-winx64\bin>net start mysql3308
MySQL3308 服务正在启动 .
MySQL3308 服务已经启动成功。

 

4、初次登录数据库并修改密码:

D:\database\mysql-8.0.13-winx64\bin>mysql -h localhost -P 3308 -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.13 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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)

修改密码:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mysql';
Query OK, 0 rows affected (0.10 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

授权其他电脑访问:

mysql> CREATE USER 'root'@'%' IDENTIFIED BY 'mysql';
Query OK, 0 rows affected (0.09 sec)

mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'mysql';
Query OK, 0 rows affected (0.04 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
Query OK, 0 rows affected (0.07 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

 

最后配置 navcat连接完美启动:

 

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

andy-luna

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值