当前位置:网站首页>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编码
双击打开这个数据库,新建一个表
创建表结构,输入对应字段
保存之后即可编辑该数据
边栏推荐
- Introduction Guide to stereo vision (5): dual camera calibration [no more collection, I charge ~]
- 2311. Longest binary subsequence less than or equal to K
- Priority queue (heap)
- 一文详解图对比学习(GNN+CL)的一般流程和最新研究趋势
- 2309. The best English letters with both upper and lower case
- The research trend of map based comparative learning (gnn+cl) in the top paper
- c语言指针深入理解
- 一题多解,ASP.NET Core应用启动初始化的N种方案[上篇]
- C form click event did not respond
- 微信小程序获取住户地区信息
猜你喜欢
LeetCode 496. 下一个更大元素 I
Global configuration tabbar
Applet network data request
C语言-从键盘输入数组二维数组a,将a中3×5矩阵中第3列的元素左移到第0列,第3列以后的每列元素行依次左移,原来左边的各列依次绕到右边
LeetCode 556. 下一个更大元素 III
Progressive JPEG pictures and related
Priority queue (heap)
AUTOSAR from getting started to mastering 100 lectures (103) -dbc file format and creation details
混淆矩阵(Confusion Matrix)
fs. Path module
随机推荐
c语言指针深入理解
Node collaboration and publishing
Progressive JPEG pictures and related
OpenGL - Model Loading
NIPS2021 | 超越GraphCL,GNN+对比学习的节点分类新SOTA
Analysis of eventbus source code
[ctfhub] Title cookie:hello guest only admin can get flag. (cookie spoofing, authentication, forgery)
Editor use of VI and VIM
notepad++
云计算技术热点
Global configuration tabbar
Svg optimization by svgo
np.allclose
Confusion matrix
Kotlin introductory notes (I) kotlin variables and non variables
Unity SKFramework框架(二十三)、MiniMap 小地图工具
[code practice] [stereo matching series] Classic ad census: (4) cross domain cost aggregation
Luo Gu p3177 tree coloring [deeply understand the cycle sequence of knapsack on tree]
Causes and appropriate analysis of possible errors in seq2seq code of "hands on learning in depth"
Shutter uses overlay to realize global pop-up