大家好,我是考100分的小小码 ,祝大家学习进步,加薪顺利呀。今天说一说mysql 8.0 安装教程「建议收藏」,希望您对编程的造诣更进一步.
windows 压缩包方式安装
官方步骤:
1. Extract the main archive to the desired install directory
解压安装包到自定义安装目录
2. Optional: also extract the debug-test archive if you plan to execute the MySQL benchmark and test suite
可选项:若想执行mysql基准和测试套件,可解压官网下载的调试测试包
3. Create an option file
创建可选配置文件:定义mysql服务器启动参数 完整配置
配置文件优先级:my.ini > my.cnf
配置文件放置目录:msyql 安装根目录即可
[mysqld]
# mysql安装目录
# set basedir to your installation path
basedir=E:/mysql
# mysql数组目录
# set datadir to the location of your data directory
datadir=E:/mydata/data
代码100分
4. Choose a MySQL server type
mysqld: mysql正常工作模式
mysqld-debug: mysql 调试工作模式,可调试和自动内存分配检查,排查执行出错
5. Initialize MySQL
mysql8.0 账户验证方式变更:mysql_native_password -> caching_sha2_password
数据初始化方式:
- 安全,root账户密码随机生成,标识过期,控制台打印:mysqld –initialize –console
- 不安全,root账户不指定密码:mysqld –initialize-insecure –console
代码100分安全模式:
2020-06-20T14:02:59.538460Z 0 [System] [MY-013169] [Server] C:Applicationmysql-8.0.20inmysqld.exe (mysqld 8.0.20) initializing of server in progress as process 808
2020-06-20T14:02:59.634151Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-06-20T14:03:10.459155Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2020-06-20T14:03:23.438372Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: <uavdhtD2ul?
非安全模式:空密码警告手动指定root密码即可
2020-06-20T14:15:17.254891Z 0 [System] [MY-013169] [Server] C:Applicationmysql-8.0.20inmysqld.exe (mysqld 8.0.20) initializing of server in progress as process 5564
2020-06-20T14:15:17.275132Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2020-06-20T14:15:30.200787Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2020-06-20T14:15:44.389432Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
Root密码设置方式:
- 非安全方式初始化:mysqladmin -uroot password <新密码>
- 安全方式初始化:mysqladmin -uroot -p <控制台打印随机生成密码> password <新密码>
- 通用设置方式:ALTER USER “root”@”localhost” IDENTIFIED WITH mysql_native_password BY <新密码>
6. Start the MySQL server
启动mysql
- 控制台直接输入:mysqld(阻塞执行)
- 安装为windows服务,通过windows服务执行:mysqld –install <服务名> , net start <服务名>
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/7778.html