Home Database Mysql Tutorial Graphic tutorial on installing mysql5.7.18 and changing the initial password

Graphic tutorial on installing mysql5.7.18 and changing the initial password

Jun 18, 2017 am 10:55 AM
Revise about Install

这篇文章主要为大家详细介绍了Mysql5.7安装并修改初始密码的方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

Centos 安装MySQL可以参考之前写的一篇文章

Centos7.3 安装Mysql5.7并修改初始密码

windows安装mysql5.7有两种方式

1、下载.msi安装文件直接根据界面提示进行安装
2、下载.biz压缩包

这里接介绍的是第二种压缩版的安装方式

1、下载mysql

其他版本下载地址

2、安装mysql

压缩包相当于免安装文件,要想使用它只需要配置相关的参数,再通过通过服务来启动数据库服务就可以了。

2.1 把压缩包解压到你喜欢的位置

本示例解压到:D:\software\mysql-5.7.18-winx64 文件夹下

2.2 创建my.ini文件

mysql-5.7.18-winx64根目录中创建my.ini文件添加以下内容:

[mysqld]
# set basedir to your installation path
basedir=D:\\software\\mysql-5.7.18-winx64
# set datadir to the location of your data directory
datadir=D:\\software\\mysql-5.7.18-winx64\\data
port = 3306
max_allowed_packet = 32M
Copy after login

注意,basedir和datadir是必须要配置的,basedir就是你解压的目录

2.3 配置环境变量

添加一个名叫 MYSQL_HOME 的变量。
修改Path变量,在末尾添加 %MYSQL_HOME%\bin

2.4 初始化数据库文件

1、以管理员身份运行cmd,进入mysql的bin目录。
2、初始化数据库文件


mysqld --initialize
Copy after login

初始化成功后,会在datadir目录下生成一些文件,其中,xxx.err(xxx是你电脑用户的名称)文件里说明了root账户的临时密码。例子:


2017-05-17T10:31:54.235041Z 1 [Note] A temporary password is generated for root@localhost: <r8j*Qrh)jdp
Copy after login

2.5 注册mysql服务


mysqld -install MySQL
Copy after login

2.6 启动mysql服务


net start MySQL
Copy after login

3、修改root密码

使用root账号登录


mysql -u root -p <r8j*Qrh)jdp
Copy after login

修改root密码


ALTER USER &#39;root&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;new_password&#39;;
Copy after login

4、安装日志


Microsoft Windows [版本 6.3.9600]
(c) 2013 Microsoft Corporation。保留所有权利。

D:\software\mysql-5.7.18-winx64\bin>mysqld --initialize

D:\software\mysql-5.7.18-winx64\bin>
D:\software\mysql-5.7.18-winx64\bin>mysqld -install MySQL

D:\software\mysql-5.7.18-winx64\bin>net start MySQL
MySQL 服务正在启动 ....
MySQL 服务已经启动成功。


D:\software\mysql-5.7.18-winx64\bin>mysql -uroot -p
Enter password: ************
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.18

Copyright (c) 2000, 2017, 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 &#39;help;&#39; or &#39;\h&#39; for help. Type &#39;\c&#39; to clear the current input statement.

mysql> ALTER USER &#39;root&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;root&#39;;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
Copy after login

The above is the detailed content of Graphic tutorial on installing mysql5.7.18 and changing the initial password. 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 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 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 change the personal name in the group on DingTalk_How to modify the personal name in the group on DingTalk How to change the personal name in the group on DingTalk_How to modify the personal name in the group on DingTalk Mar 29, 2024 pm 08:41 PM

1. First open DingTalk. 2. Open the group chat and click the three dots in the upper right corner. 3. Find my nickname in this group. 4. Click to enter to modify and save.

Unable to install guest additions in VirtualBox Unable to install guest additions in VirtualBox Mar 10, 2024 am 09:34 AM

You may not be able to install guest additions to a virtual machine in OracleVirtualBox. When we click on Devices>InstallGuestAdditionsCDImage, it just throws an error as shown below: VirtualBox - Error: Unable to insert virtual disc C: Programming FilesOracleVirtualBoxVBoxGuestAdditions.iso into ubuntu machine In this post we will understand what happens when you What to do when you can't install guest additions in VirtualBox. Unable to install guest additions in VirtualBox If you can't install it in Virtua

What should I do if Baidu Netdisk is downloaded successfully but cannot be installed? What should I do if Baidu Netdisk is downloaded successfully but cannot be installed? Mar 13, 2024 pm 10:22 PM

If you have successfully downloaded the installation file of Baidu Netdisk, but cannot install it normally, it may be that there is an error in the integrity of the software file or there is a problem with the residual files and registry entries. Let this site take care of it for users. Let’s introduce the analysis of the problem that Baidu Netdisk is successfully downloaded but cannot be installed. Analysis of the problem that Baidu Netdisk downloaded successfully but could not be installed 1. Check the integrity of the installation file: Make sure that the downloaded installation file is complete and not damaged. You can download it again, or try to download the installation file from another trusted source. 2. Turn off anti-virus software and firewall: Some anti-virus software or firewall programs may prevent the installation program from running properly. Try disabling or exiting the anti-virus software and firewall, then re-run the installation

How to install Android apps on Linux? How to install Android apps on Linux? Mar 19, 2024 am 11:15 AM

Installing Android applications on Linux has always been a concern for many users. Especially for Linux users who like to use Android applications, it is very important to master how to install Android applications on Linux systems. Although running Android applications directly on Linux is not as simple as on the Android platform, by using emulators or third-party tools, we can still happily enjoy Android applications on Linux. The following will introduce how to install Android applications on Linux systems.

Can Douyin Blue V change its name? What are the steps to change the name of corporate Douyin Blue V account? Can Douyin Blue V change its name? What are the steps to change the name of corporate Douyin Blue V account? Mar 22, 2024 pm 12:51 PM

Douyin Blue V certification is the official certification of a company or brand on the Douyin platform, which helps enhance brand image and credibility. With the adjustment of corporate development strategy or the update of brand image, the company may want to change the name of Douyin Blue V certification. So, can Douyin Blue V change its name? The answer is yes. This article will introduce in detail the steps to modify the name of the enterprise Douyin Blue V account. 1. Can Douyin Blue V change its name? You can change the name of Douyin Blue V account. According to Douyin’s official regulations, corporate Blue V certified accounts can apply to change their account names after meeting certain conditions. Generally speaking, enterprises need to provide relevant supporting materials, such as business licenses, organization code certificates, etc., to prove the legality and necessity of changing the name. 2. What are the steps to modify the name of corporate Douyin Blue V account?

How to install Podman on Ubuntu 24.04 How to install Podman on Ubuntu 24.04 Mar 22, 2024 am 11:26 AM

If you have used Docker, you must understand daemons, containers, and their functions. A daemon is a service that runs in the background when a container is already in use in any system. Podman is a free management tool for managing and creating containers without relying on any daemon such as Docker. Therefore, it has advantages in managing containers without the need for long-term backend services. Additionally, Podman does not require root-level permissions to be used. This guide discusses in detail how to install Podman on Ubuntu24. To update the system, we first need to update the system and open the Terminal shell of Ubuntu24. During both installation and upgrade processes, we need to use the command line. a simple

How to Install and Run the Ubuntu Notes App on Ubuntu 24.04 How to Install and Run the Ubuntu Notes App on Ubuntu 24.04 Mar 22, 2024 pm 04:40 PM

While studying in high school, some students take very clear and accurate notes, taking more notes than others in the same class. For some, note-taking is a hobby, while for others, it is a necessity when they easily forget small information about anything important. Microsoft's NTFS application is particularly useful for students who wish to save important notes beyond regular lectures. In this article, we will describe the installation of Ubuntu applications on Ubuntu24. Updating the Ubuntu System Before installing the Ubuntu installer, on Ubuntu24 we need to ensure that the newly configured system has been updated. We can use the most famous &quot;a&quot; in Ubuntu system

Detailed steps to install Go language on Win7 computer Detailed steps to install Go language on Win7 computer Mar 27, 2024 pm 02:00 PM

Detailed steps to install Go language on Win7 computer Go (also known as Golang) is an open source programming language developed by Google. It is simple, efficient and has excellent concurrency performance. It is suitable for the development of cloud services, network applications and back-end systems. . Installing the Go language on a Win7 computer allows you to quickly get started with the language and start writing Go programs. The following will introduce in detail the steps to install the Go language on a Win7 computer, and attach specific code examples. Step 1: Download the Go language installation package and visit the Go official website

See all articles