当前位置:网站首页>mysql安装配置以及创建数据库和表
mysql安装配置以及创建数据库和表
2022-07-05 09:25:00 【本卡】
mysql安装配置
1、安装
鉴于我自己的环境是window11,所以这里展示的是win版的安装
安装地址:https://dev.mysql.com/downloads/mysql/

这里我选择的是上一个Windows (x86, 64-bit), ZIP Archive,点击对应的download
进入该界面后,不用管这些注册内容,点击no thanks,just start my download就可以
在c盘(也可自己选择)中创建一个mysql文件夹,然后把下载好的压缩包解压到里面
2、配置
进行好上面的步骤之后我们进行配置
在文件中先创建一个my.ini文件,输入以下内容(注意:其中basedir必须是自己的安装目录!!!)
[client]
# 设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
# 设置3306端口
port = 3306
# 设置mysql的安装目录
basedir=C:\\mysql\\mysql-8.0.29-winx64
# 设置 mysql数据库的数据的存放目录,MySQL 8+ 不需要以下配置,系统自己生成即可,否则有可能报错
# datadir=C:\\mysql\\mysql-8.0.29-winx64
# 允许最大连接数
max_connections=20
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
然后在系统环境里配置好(如最后一行)
3、启动
打开cmd,切换目录(自己的目录!!)
cd C:\mysql\mysql-8.0.29-winx64\bin
初始化数据库
mysqld --initialize --console
执行之后会显示出形如下面的初始密码
...
2022-04-20T02:35:05.464644Z 5 [Note] [MY-010454] [Server] A temporary password is generated for [email protected]: APWCY5ws&hjQ
...
比如这里APWCY5ws&hjQ就是初始密码
4、Navicat安装
为了更好的使用mysql,建议再安装一个图形界面navicat来操作mysql
安装链接https://www.navicat.com/en/download/navicat-for-mysql
我这里安装的是win64位的试用版
下载之后运行exe文件
点击next
点击accept
选择安装目录

是否安装快捷方式
点击安装等待安装
安装完成
5、建立一个数据库
我这里展示一个数据库建立过程,主要是建立中国各地的人均工资水平
首先打开navicat for sql进行链接
自己选择写一个connection name,输入password,即可链接成功
右键新建数据库
给新建的数据库命名,并规范数据库为utf-8编码
双击打开这个数据库,新建一个表
创建表结构,输入对应字段
保存之后即可编辑该数据
边栏推荐
- Rebuild my 3D world [open source] [serialization-2]
- SMT32H7系列DMA和DMAMUX的一点理解
- My life
- [code practice] [stereo matching series] Classic ad census: (6) multi step parallax optimization
- Creation and reference of applet
- Kotlin introductory notes (VIII) collection and traversal
- [Yugong series] go teaching course 003-ide installation and basic use in July 2022
- OpenGL - Coordinate Systems
- 一篇文章带你走进cookie,session,Token的世界
- Greendao reported an error in qigsaw, could not init daoconfig
猜你喜欢

牛顿迭代法(解非线性方程)
![[code practice] [stereo matching series] Classic ad census: (6) multi step parallax optimization](/img/54/cb1373fbe7b21c5383580e8b638a2c.jpg)
[code practice] [stereo matching series] Classic ad census: (6) multi step parallax optimization

Svg optimization by svgo

High performance spark_ Transformation performance

混淆矩阵(Confusion Matrix)
![Introduction Guide to stereo vision (4): DLT direct linear transformation of camera calibration [recommended collection]](/img/ed/0483c529db2af5b16b18e43713d1d8.jpg)
Introduction Guide to stereo vision (4): DLT direct linear transformation of camera calibration [recommended collection]

What is a firewall? Explanation of basic knowledge of firewall

OpenGL - Coordinate Systems

Applet customization component

【组队 PK 赛】本周任务已开启 | 答题挑战,夯实商品详情知识
随机推荐
Ministry of transport and Ministry of Education: widely carry out water traffic safety publicity and drowning prevention safety reminders
Applet network data request
C # image difference comparison: image subtraction (pointer method, high speed)
Applet data attribute method
交通运输部、教育部:广泛开展水上交通安全宣传和防溺水安全提醒
Return of missing persons
LeetCode 31. 下一个排列
Unity SKFramework框架(二十四)、Avatar Controller 第三人称控制
. Net service governance flow limiting middleware -fireflysoft RateLimit
Luo Gu p3177 tree coloring [deeply understand the cycle sequence of knapsack on tree]
Lepton 无损压缩原理及性能分析
Kotlin introductory notes (III) kotlin program logic control (if, when)
Solution to the problems of the 17th Zhejiang University City College Program Design Competition (synchronized competition)
[ManageEngine] how to make good use of the report function of OpManager
一文详解图对比学习(GNN+CL)的一般流程和最新研究趋势
The research trend of map based comparative learning (gnn+cl) in the top paper
Talking about the difference between unittest and pytest
OpenGL - Coordinate Systems
Jenkins pipeline method (function) definition and call
Applet global style configuration window