我是靠谱客的博主 斯文黄豆,这篇文章主要介绍在Windows10上安装配置MySQL5.8,现在分享给大家,希望可以做个参考。

  1. 下载MySQL8.0 Windows zip包

下载地址

  1. 解压至安装目录

  2. 将安装目录/bin添加到PATH环境变量里

  3. 在安装目录下新建文件my.ini并写入基本配置

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[mysqld] # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. # basedir是安装目录 basedir = D:ProgramMySQL # datadir是mysql数据目录 datadir = D:DBsMySQL # 端口号 port = 3306 # server_id = ..... # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES character-set-server = utf8mb4 performance_schema_max_table_instances = 600 table_definition_cache = 400 table_open_cache = 256 [mysql] default-character-set = utf8mb4 [client] default-character-set = utf8mb4
  1. 初始化数据库
    执行mysqld --initialize --console
    执行完成后,会打印 root 用户的初始默认密码,比如:
复制代码
1
2
3
4
5
2018-04-20T02:35:01.507037Z 0 [Warning] [MY-010915] [Server] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release. 2018-04-20T02:35:01.507640Z 0 [System] [MY-013169] [Server] D:ProgramMySQL8binmysqld.exe (mysqld 8.0.11) initializing of server in progress as process 11064 2018-04-20T02:35:01.508173Z 0 [ERROR] [MY-010340] [Server] Error message file 'D:ProgramMySQLshareenglisherrmsg.sys' had only 1090 error messages, but it should contain at least 4512 error messages. Check that the above file is the right version for this program! 2018-04-20T02:35:05.464644Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: APWCY5ws&hjQ 2018-04-20T02:35:07.017280Z 0 [System] [MY-013170] [Server] D:ProgramMySQL8binmysqld.exe (mysqld 8.0.11) initializing of server has completed

其中,第4行的“APWCY5ws&hjQ”就是初始密码,在没有更改密码前,需要记住这个密码,后续登录需要用到。
6. 安装服务
执行mysqld --install

  1. 登录mysql
    mysql -uroot -p
    然后输出之前的初始密码

  2. 修改登录密码

复制代码
1
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

【转载自】https://blog.csdn.net/zwj1030711290/article/details/80039780

最后

以上就是斯文黄豆最近收集整理的关于在Windows10上安装配置MySQL5.8的全部内容,更多相关在Windows10上安装配置MySQL5内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(71)

评论列表共有 0 条评论

立即
投稿
返回
顶部