mysql 笔记打包下载_mysql 5.7压缩包安装笔记
重裝系統(tǒng)之后準備安裝mysql,看到官網(wǎng)上有mysql 5.7.10可以下載就點了,然后就開始了漫長的安裝路程,總共折騰差不多一個多小時,最后終于安裝成功了,這里把安裝過程寫下來,給自己做個筆記,也給后來人一個安裝提示.
1.下載安裝包
直接點擊或者復(fù)制之后就可以下載了,不嫌麻煩或者想體驗其他版本的也可以去官網(wǎng)下載,但是請注意,筆記只在5.7.10這個版本下運行成功,其他版本(僅供參考)需要參考官方的安裝文檔!
2.解壓縮文件夾到本地磁盤
我把文件放在了
C:\Program_Files\mysql-5.7.10-winx64
3.復(fù)制my-default.ini為my.ini
建議復(fù)制一份,或者直接把my-default.ini重命名為my.ini
4.填寫my.ini相關(guān)內(nèi)容
basedir=C:\Program_Files\mysql-5.7.10-winx64
datadir=C:\Program_Files\mysql-5.7.10-winx64\data
port=3306
路徑請?zhí)鎿Q成自己實際路徑!
5.環(huán)境變量
新增環(huán)境變量,如下圖
修改path,注意是修改,增加的是后面我選中的部分
%MYSQL_HOME%\bin;
6.管理員權(quán)限運行[命令提示符]
盡量使用管理員權(quán)限運行,否則,可能出現(xiàn)無法安裝或者無法啟動服務(wù)等問題!
7.執(zhí)行mysql初始化data
mysqld --initialize --console
結(jié)果如下:
C:\Windows\system32>mysqld --initialize --console2015-12-25T03:01:33.140732Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation formore details).2015-12-25T03:01:33.140732Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode ina future release.2015-12-25T03:01:33.140732Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.2015-12-25T03:01:34.614085Z 0 [Warning] InnoDB: New log files created, LSN=45790
2015-12-25T03:01:34.775606Z 0[Warning] InnoDB: Creating foreign key constraint system tables.2015-12-25T03:01:34.872089Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: ceb98c90-aab3-11e5-8ca7-b870f4733564.2015-12-25T03:01:34.872089Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed'cannot be opened.2015-12-25T03:01:34.891376Z 1 [Note] A temporary password is generated for root@localhost: +>><=Gs,0spF
請注意,最后一句包含我們所需要的初始化密碼!!!!
8.安裝mysql服務(wù),并啟動
C:\Windows\system32>mysqld -install
Service successfully installed.
C:\Windows\system32>net start mysql
MySQL 服務(wù)正在啟動 .
MySQL 服務(wù)已經(jīng)啟動成功。
9.登錄mysql并修改密碼
請注意,我下面的密碼和上面的那個初始化密碼不一樣了,因為我有重新卸載了服務(wù)然后重新執(zhí)行了一遍 7和8 ,因為上面的密碼提示我無法登錄,"
C:\Windows\system32>mysql -uroot -pih.sQWazK9*7
mysql> set password for 'root'@'localhost'="你的密碼";
Query OK,0 rows affected (0.00 sec)
好了,現(xiàn)在退出
mysql>exit
Bye
10.修改遠程登錄
到上面9 的時候本機已經(jīng)可以正常使用mysql的功能了,不過如果需要遠程登錄mysql的話需要下面的設(shè)置
C:\Windows\system32>mysql -uroot -p你的密碼
mysql: [Warning] Using a password on the command lineinterfacecan be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection idis 3Server version:5.7.10MySQL Community Server (GPL)
Copyright (c)2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracleis 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>use mysql
Database changed
mysql> select host,user fromuser;+-----------+-----------+
| host | user |
+-----------+-----------+
| localhost | mysql.sys |
| localhost | root |
+-----------+-----------+
2 rows in set (0.00sec)mysql> update user set host='%' where user = 'root';
Query OK,1 row affected (0.00sec)
Rows matched:1 Changed: 1 Warnings: 0mysql> select host,user fromuser;+-----------+-----------+
| host | user |
+-----------+-----------+
| % | root |
| localhost | mysql.sys |
+-----------+-----------+
2 rows in set (0.00sec)
mysql>
好了,到這里全部完成了,開始你的mysql之旅吧!
總結(jié)
以上是生活随笔為你收集整理的mysql 笔记打包下载_mysql 5.7压缩包安装笔记的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 英雄联盟手游金身是哪个
- 下一篇: java 递归函数_浅谈java递归函数