【安装部署】Mysql下载及其安装的详细步骤

1.下载压缩包

官网地址:www.mysql.com

2.环境配置

1.先解压压缩包

2.配置环境变量

添加环境变量:我的电脑--->属性-->高级-->环境变量-->系统变量-->path

3.在mysql安装目录下新建my.ini文件并,编辑my.ini文件

编辑内容如下:

mysqld

#设置3306端口

port=3306

#设置mysql的安装目录

basedir=D:\develop-soft\mysql\mysql-8.1.0-winx64\database

#设置mysql数据库的数据的存放目录

datadir=D:\develop-soft\mysql\mysql-8.1.0-winx64\database\data

max_connections=200

#允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统

max_connect_errors=10

#服务端使用的字符集默认为UTF8

character-set-server=utf8

#创建新表时将使用的默认存储引擎

default-storage-engine=INNODB

#默认使用"mysql_native_password"插件认证

default_authentication_plugin=mysql_native_password

mysql

#设置mysql客户端默认字符集

default-character-set=utf8

client

#设置mysql客户端连接服务端时默认使用的端口

port=3306

default-character-set=UTF8

3.执行命令

1.初始化mysql,命令如下:

mysqld --initialize-insecure

2.安装Mysql,命令如下:

mysqld -install mysql

3.无密码启动Mysql

mysqld --console --skip-grant-tables --shared-memory

开启新的窗口继续执行命令如下:

1.刷新权限

flush privileges;

2.修改密码:

alter user 'root'@'localhost' identified with mysql_native_password by '密码';

4.遇到的问题

1.由于找不到VCRUNTIME140_1.dll,无法继续执行代码,重新安装程序可能会解决此问题

1.1下载地址

Download Visual C++ Redistributable for Visual Studio 2015 from Official Microsoft Download Center

1.2 安装完成后,将文件vcruntime140_1.dll,放到C:\Windows\System32目录下

2.Install/Remove of the Service Denied!

以管理员身份启动cmd,重新执行对应命令

3.Found option without preceding group in config file

将my.ini 文件的编码格式设置为ANSI

相关推荐
TG_yunshuguoji1 分钟前
阿里云国际代理:阿里云的云数据库是什么?
服务器·数据库·安全·阿里云·云计算
程序猿 董班长1 小时前
springboot配置多数据源(mysql、hive)
hive·spring boot·mysql
huazhixuthink1 小时前
PostgreSQL三种关闭方式的区别
数据库·postgresql
阿里小阿希6 小时前
Vue3 + Element Plus 项目中日期时间处理的最佳实践与数据库设计规范
数据库·设计规范
且行志悠7 小时前
Mysql的使用
mysql
白鹭7 小时前
MySQL源码部署(rhel7)
数据库·mysql
666和7777 小时前
Struts2 工作总结
java·数据库
还听珊瑚海吗7 小时前
SpringMVC(一)
数据库