windows10安裝mysql8.0.11(免安裝版)
1.MySQL8.0.11下載網址: https://dev.mysql.com/downloads/mysql/
2.配置環境變量:我的電腦->屬性->高級系統設置->環境變量->系統變量->Path:新增MySQL解壓文件中bin的路徑(D:\mysql-8.0.11\bin)
3.在解壓的文件夾(D:\mysql-8.0.11)中新建名為data的文件夾和名為my.ini 的文件,打開my.ini,寫入下面的配置:
[mysqld] # set basedir to your installation path 設置解壓文件mysql文件夾的路徑(D:/mysql-8.0.11 -->將此處替換為自己的路徑) basedir=D:/mysql-8.0.11 # set datadir to the location of your data directory 設置剛才創建data文件夾的路徑(D:/mysql-8.0.11/data -->將此處替換為自己的路徑) datadir=D:/mysql-8.0.11/data
4.安裝mysql,管理員身份打開cmd命令框切換到 D:\mysql-8.0.11目錄下輸入 :
D:\mysql-8.0.11>bin\mysqld --initialize-insecure
D:\mysql-8.0.11>bin\mysqld --install
5.啟動mysql,先切換到bin目錄下,然後輸入net start mysql (停止服務:net stop mysql):
D:\mysql-8.0.11\bin>net start mysql MySQL 服務正在啟動 . MySQL 服務已經啟動成功。
6.登陸mysql並修改密碼(此方法安裝初始密碼為空,輸入 mysql -u root 即可登陸,修改密碼:alter user ‘root‘@‘localhost‘identified by ‘123456‘;):
D:\mysql-8.0.11\bin>mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection idis 8 Server version: 8.0.11 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> alter user ‘root‘@‘localhost‘identified by ‘123456‘;
至此,mysql數據路已安裝好了。
其他問題:
(1).遠程連接
a.是否關閉本機防火墻(或者開放3306端口,參考鏈接:https://blog.csdn.net/spt_dream/article/details/75014619)
b.可能需要重新設置修改密碼的方式,登陸mysql:
mysql> alter user ‘root‘@‘%‘identified with mysql_native_password by ‘12340‘; Query OK, 0 rows affected (0.05 sec) mysql> flush privileges;
c.是否需要授權,參考鏈接:https://www.cnblogs.com/skyWings/p/5952795.html
https://www.2cto.com/database/201805/750575.html
https://blog.csdn.net/u013067166/article/details/49951577
(2).其他問題,可參考官方文檔:https://dev.mysql.com/doc/refman/8.0/en/windows-install-archive.html
windows10安裝mysql8.0.11(免安裝版)