Table of Contents
一、下载
二、安装
1 解压
2 配置环境变量
右击此电脑选择属性
双击系统环境变量的Path
3 配置my.ini
4 命令行启动mysql
WIN+R 输入cmd 进入window命令行
cd 进入安装mysql的bin目录下
5 修改登录密码
Home Database Mysql Tutorial How to install MySQL8.0.x version on Windows

How to install MySQL8.0.x version on Windows

May 27, 2023 pm 07:34 PM
mysql windows

    一、下载

    MySQL官网下载链接:https://downloads.mysql.com/archives/community/

    选择版本后下载zip文件

    How to install MySQL8.0.x version on Windows

    博主选择的是8.0.13

    二、安装

    1 解压

    把下载好的zip包在你想要的路径下直接解压。

    解压完成后得到这个界面:

    How to install MySQL8.0.x version on Windows

    2 配置环境变量

    右击此电脑选择属性

    How to install MySQL8.0.x version on Windows

    How to install MySQL8.0.x version on Windows

    双击系统环境变量的Path

    How to install MySQL8.0.x version on Windows

    新建一个刚刚你解压的路径(注意要到bin路径下)

    3 配置my.ini

    How to install MySQL8.0.x version on Windows

    在D:\Program Files (x86)\mysql-8.0.13-winx64\mysql-8.0.13-winx64路径下新建一个 my.ini 文件。

    这里有一个注意点:如果出现mysql8.0安装报错 error: Found option without preceding group in config file:

    则把ini文件另存为ANSI编码

    文件内容如下:

    [mysqld]
    
    # 设置3306端口
    
    port=3306
    
    # 设置mysql的安装目录
    
    basedir=D:\\Program Files (x86)\\mysql-8.0.13-winx64\\mysql-8.0.13-winx64
    
    # 切记此处一定要用双斜杠\\,单斜杠这里会出错。
    
    # 设置mysql数据库的数据的存放目录
    
    datadir=D:\Program Files (x86)\mysql-8.0.13-winx64\\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
    Copy after login

    4 命令行启动mysql

    WIN+R 输入cmd 进入window命令行

    How to install MySQL8.0.x version on Windows

    cd 进入安装mysql的bin目录下

    How to install MySQL8.0.x version on Windows

    输入:mysqld --initialize --console

    等待片刻会输出一堆东西,推荐先把这些输出复制一下,放到一个记事本里,因为里面会有你需要的数据库初始密码。

    一般会在root@localhost:之后(是一堆像乱码一样的东西,这是初始的随机密码,后续我们会进行更改!)

    记下密码之后,执行命令:mysqld --install 安装mysql

    正常会输出 successfully

    之后执行命令:net start mysql 启动mysql服务

    5 修改登录密码

    命令:mysql -u root -p 之后复制你刚刚保存在txt文件的初始密码进入mysql

    命令:alter user root@localhost identified by '123456'; 这个 123456是我随便打的 可以自定义修改,如果是mysql8以上,推荐别使用纯数字密码,别问我为什么,都是被坑出来的教训!

    注:如果出现忘记初始随机密码的情况,可以重新执行mysqld --initialize --console这个命令,但是前提是删除之前生成的Data文件夹

    How to install MySQL8.0.x version on Windows

    The above is the detailed content of How to install MySQL8.0.x version on Windows. For more information, please follow other related articles on the PHP Chinese website!

    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

    Hot AI Tools

    Undresser.AI Undress

    Undresser.AI Undress

    AI-powered app for creating realistic nude photos

    AI Clothes Remover

    AI Clothes Remover

    Online AI tool for removing clothes from photos.

    Undress AI Tool

    Undress AI Tool

    Undress images for free

    Clothoff.io

    Clothoff.io

    AI clothes remover

    AI Hentai Generator

    AI Hentai Generator

    Generate AI Hentai for free.

    Hot Article

    R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
    2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
    Repo: How To Revive Teammates
    1 months ago By 尊渡假赌尊渡假赌尊渡假赌
    Hello Kitty Island Adventure: How To Get Giant Seeds
    4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

    Hot Tools

    Notepad++7.3.1

    Notepad++7.3.1

    Easy-to-use and free code editor

    SublimeText3 Chinese version

    SublimeText3 Chinese version

    Chinese version, very easy to use

    Zend Studio 13.0.1

    Zend Studio 13.0.1

    Powerful PHP integrated development environment

    Dreamweaver CS6

    Dreamweaver CS6

    Visual web development tools

    SublimeText3 Mac version

    SublimeText3 Mac version

    God-level code editing software (SublimeText3)

    How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? Feb 21, 2025 pm 10:54 PM

    The way to update ByBit exchanges varies by platform and device: Mobile: Check for updates and install in the app store. Desktop Client: Check for updates in the Help menu and install automatically. Web page: You need to manually access the official website for updates. Failure to update the exchange can lead to security vulnerabilities, functional limitations, compatibility issues and reduced transaction execution efficiency.

    Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Pi Node Teaching: What is a Pi Node? How to install and set up Pi Node? Mar 05, 2025 pm 05:57 PM

    Detailed explanation and installation guide for PiNetwork nodes This article will introduce the PiNetwork ecosystem in detail - Pi nodes, a key role in the PiNetwork ecosystem, and provide complete steps for installation and configuration. After the launch of the PiNetwork blockchain test network, Pi nodes have become an important part of many pioneers actively participating in the testing, preparing for the upcoming main network release. If you don’t know PiNetwork yet, please refer to what is Picoin? What is the price for listing? Pi usage, mining and security analysis. What is PiNetwork? The PiNetwork project started in 2019 and owns its exclusive cryptocurrency Pi Coin. The project aims to create a one that everyone can participate

    How to install deepseek How to install deepseek Feb 19, 2025 pm 05:48 PM

    There are many ways to install DeepSeek, including: compile from source (for experienced developers) using precompiled packages (for Windows users) using Docker containers (for most convenient, no need to worry about compatibility) No matter which method you choose, Please read the official documents carefully and prepare them fully to avoid unnecessary trouble.

    Coinsuper exchange software channel official website entrance Coinsuper exchange software channel official website entrance Feb 21, 2025 pm 10:39 PM

    The official website entrance of the Coinsuper Exchange: https://www.coinsuper.com. The client download channels are: Windows client, macOS client, and mobile (iOS/Android). Registration requires an email, mobile phone number and password, and you need to complete real-name authentication before you can trade. The platform provides a variety of digital asset transactions, including Bitcoin, Ethereum, etc., with the transaction fee rate of 0.1% for both orders and acceptors. Security safeguards include cold wallet storage, dual-factor verification, anti-money laundering and anti-terrorism financing measures, and with security public

    BITGet official website installation (2025 beginner's guide) BITGet official website installation (2025 beginner's guide) Feb 21, 2025 pm 08:42 PM

    BITGet is a cryptocurrency exchange that provides a variety of trading services including spot trading, contract trading and derivatives. Founded in 2018, the exchange is headquartered in Singapore and is committed to providing users with a safe and reliable trading platform. BITGet offers a variety of trading pairs, including BTC/USDT, ETH/USDT and XRP/USDT. Additionally, the exchange has a reputation for security and liquidity and offers a variety of features such as premium order types, leveraged trading and 24/7 customer support.

    Ouyi okx installation package is directly included Ouyi okx installation package is directly included Feb 21, 2025 pm 08:00 PM

    Ouyi OKX, the world's leading digital asset exchange, has now launched an official installation package to provide a safe and convenient trading experience. The OKX installation package of Ouyi does not need to be accessed through a browser. It can directly install independent applications on the device, creating a stable and efficient trading platform for users. The installation process is simple and easy to understand. Users only need to download the latest version of the installation package and follow the prompts to complete the installation step by step.

    Get the gate.io installation package for free Get the gate.io installation package for free Feb 21, 2025 pm 08:21 PM

    Gate.io is a popular cryptocurrency exchange that users can use by downloading its installation package and installing it on their devices. The steps to obtain the installation package are as follows: Visit the official website of Gate.io, click "Download", select the corresponding operating system (Windows, Mac or Linux), and download the installation package to your computer. It is recommended to temporarily disable antivirus software or firewall during installation to ensure smooth installation. After completion, the user needs to create a Gate.io account to start using it.

    The latest version download of gate.io The latest version download of gate.io Mar 05, 2025 pm 07:51 PM

    Need to download the Gate.io app to start your cryptocurrency journey? This guide details the latest version download steps for iOS, Android, and Windows devices. Simply visit the official website, find the download link and select the appropriate option based on your device. For iOS, it will go directly to the App Store, while Android and Windows users will download the APK or installer for manual installation. Once installed, you can launch the app and set up your account to step into the world of cryptocurrency.

    See all articles