windows10安装mysql8.0.11(免安装版)
程序员文章站
2022-03-14 15:34:44
1.MySQL8.0.11下载网址: https://dev.mysql.com/downloads/mysql/ 2.配置环境变量:我的电脑->属性->高级系统设置->环境变量->系统变量->Path:新增MySQL解压文件中bin的路径(D:\mysql-8.0.11\bin) 3.在解压的文件 ......
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 id is 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端口,参考链接:)
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.是否需要授权,参考链接:
(2).其他问题,可参考官方文档: