码迷,mamicode.com
首页 > 数据库 > 详细

MySQL安装1

时间:2019-01-05 15:11:16      阅读:294      评论:0      收藏:0      [点我收藏+]

标签:new   inf   pat   resolve   mysql\   its   storage   help   unit   

MySQL 官方参考手册https://dev.mysql.com/doc/refman/5.7/en/installing.html

 

1、Windows 上安装 MySQL

步骤一:下载 MySQL Installer(适用于Windows),并让它安装和配置系统上的所有 MySQL 产品。

下载地址:https://dev.mysql.com/downloads/installer/

 

技术分享图片

 

步骤二:双击运行 mysql-installer-community-5.7.24.0.msi

 技术分享图片

 

步骤三:这里我选择自定义(Custom),也可以选择 Developer Default 安装默认的所有文件

 技术分享图片

 

步骤四:选择只安装 MySQL Server 5.7.24-X64,将其移动到右边,点击Next

技术分享图片

 

技术分享图片

 

技术分享图片

 

技术分享图片

 

技术分享图片

 

技术分享图片

 

步骤五:设置 root 用户的密码,同时可以通过 add user 添加用户

 技术分享图片

 

技术分享图片

 

步骤六:设置 mysql 服务的名称,这里我用默认

 技术分享图片

 

技术分享图片

 

技术分享图片

 

技术分享图片

 

技术分享图片

 

 说明:

Ⅰ、安装完成 mysql 之后,默认 mysql 安装在:   C:\Program Files\MySQL\MySQL Server 5.7

 技术分享图片

 

  • bin:存储可执行文件
  • include:存储包含的头文件
  • lib:存储库文件
  • share:错误信息和字符集文件

 

Ⅱ、默认数据存放文件以及 my.ini 的配置文件在: C:\ProgramData\MySQL\MySQL Server 5.7

 技术分享图片

 

 Ⅲ、mysql 的配置文件为 my.ini 文件

 

[client]
# 指定客户端从3306端口进入
# pipe=

# socket=MYSQL

port=3306


[mysql]
# 指定客户端的默认字符集
no-beep

default-character-set=utf8

[mysqld]

# The next three options are mutually exclusive to SERVER_PORT below.
# skip-networking
# enable-named-pipe
# shared-memory

# shared-memory-base-name=MYSQL

# The Pipe the MySQL Server will use
# socket=MYSQL

# 设置服务端的端口号
# The TCP/IP Port the MySQL Server will listen on
port=3306

# 指定mysql的安装路径
# Path to installation directory. All paths are usually resolved relative to this.
# basedir="C:/Program Files/MySQL/MySQL Server 5.7/"

# 指定数据的存放路径
# Path to the database root
datadir=C:/ProgramData/MySQL/MySQL Server 5.7/Data

# 指定服务端使用的默认字符集
# The default character set that will be used when a new schema or table is
# created and no character set is defined
character-set-server=utf8

# 指定创建新表使用的默认存储引擎
# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB

......

 

Ⅳ、重启 mysql 服务

技术分享图片

 

Ⅴ、配置环境变量

配置 MYSQL_HOME 

技术分享图片

 

配置 path ,添加:

技术分享图片

 

或者添加:

技术分享图片

 

Ⅵ、测试

C:\Users\ys951>mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.24-log MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type help; or \h for help. Type \c to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.00 sec)

 

Ⅶ、也可以使用官方的可视化工具以及第三方的可视化工具操作数据库

在安装 mysql 的时候将 workbench 工具也选中进行安装

技术分享图片

 

MySQL安装1

标签:new   inf   pat   resolve   mysql\   its   storage   help   unit   

原文地址:https://www.cnblogs.com/ys951207/p/10224418.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!