欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

mysql5.7.18安裝并修改初始密碼的方法

 更新時(shí)間:2017年06月13日 08:38:06   作者:智慧云端日記  
這篇文章主要為大家詳細(xì)介紹了Mysql5.7安裝并修改初始密碼的方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

Centos 安裝MySQL可以參考之前寫的一篇文章

Centos7.3 安裝Mysql5.7并修改初始密碼

windows安裝mysql5.7有兩種方式

1、下載.msi安裝文件直接根據(jù)界面提示進(jìn)行安裝
2、下載.biz壓縮包

這里接介紹的是第二種壓縮版的安裝方式

官方的參考文檔 https://dev.mysql.com/doc/refman/5.7/en/windows-install-archive.html

1、下載mysql

其他版本下載地址

https://dev.mysql.com/downloads/mysql/

2、安裝mysql

壓縮包相當(dāng)于免安裝文件,要想使用它只需要配置相關(guān)的參數(shù),再通過通過服務(wù)來啟動(dòng)數(shù)據(jù)庫(kù)服務(wù)就可以了。

2.1 把壓縮包解壓到你喜歡的位置

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

2.2 創(chuàng)建my.ini文件

mysql-5.7.18-winx64根目錄中創(chuàng)建my.ini文件添加以下內(nèi)容:

[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 

注意,basedir和datadir是必須要配置的,basedir就是你解壓的目錄

2.3 配置環(huán)境變量

添加一個(gè)名叫 MYSQL_HOME 的變量。
修改Path變量,在末尾添加 %MYSQL_HOME%\bin

2.4 初始化數(shù)據(jù)庫(kù)文件

1、以管理員身份運(yùn)行cmd,進(jìn)入mysql的bin目錄。
2、初始化數(shù)據(jù)庫(kù)文件

mysqld --initialize

初始化成功后,會(huì)在datadir目錄下生成一些文件,其中,xxx.err(xxx是你電腦用戶的名稱)文件里說明了root賬戶的臨時(shí)密碼。例子:<r8j*Qrh)jdp就是root賬戶的臨時(shí)密碼

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

2.5 注冊(cè)mysql服務(wù)

mysqld -install MySQL 

2.6 啟動(dòng)mysql服務(wù)

net start MySQL 

3、修改root密碼

使用root賬號(hào)登錄

mysql -u root -p <r8j*Qrh)jdp

修改root密碼

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password'; 

4、安裝日志

Microsoft Windows [版本 6.3.9600]
(c) 2013 Microsoft Corporation。保留所有權(quán)利。

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 服務(wù)正在啟動(dòng) ....
MySQL 服務(wù)已經(jīng)啟動(dòng)成功。


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 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論