Windows下安装MySQL5.6
1、进入mysql解压后的目录下
安装MySQL服务,服务名为MySQL5.6
D:\tools\mysql-5.6.51-winx64\bin>mysqld --install MySQL5.6
Service successfully installed.
D:\tools\mysql-5.6.51-winx64\bin>
卸载MySQL服务,服务名为MySQL5.6
D:\tools\mysql-5.6.51-winx64\bin>mysqld --remove MySQL5.6
Service successfully removed.
2、查看服务services.msc
3、启动服务
4、登陆数据库
查看MySQL数据库安装目录和数据文件目录:
mysql> show global variables like "%datadir%";
+---------------+------------------------------+
| Variable_name | Value |
+---------------+------------------------------+
| datadir | D:\mysql-5.6.51-winx64\data\ |
+---------------+------------------------------+
1 row in set (0.00 sec)
mysql> show global variables like "%basedir%";
+---------------+-------------------------+
| Variable_name | Value |
+---------------+-------------------------+
| basedir | D:\mysql-5.6.51-winx64\ |
+---------------+-------------------------+
1 row in set (0.00 sec)
mysql>
mysql> select @@datadir;
+---------------+------------------------------+
| Variable_name | Value |
+---------------+------------------------------+
| datadir | D:\mysql-5.6.51-winx64\data\ |
+---------------+------------------------------+
1 row in set (0.00 sec)
mysql> select @@basedir;
+---------------+-------------------------+
| Variable_name | Value |
+---------------+-------------------------+
| basedir | D:\mysql-5.6.51-winx64\ |
+---------------+-------------------------+
1 row in set (0.00 sec)
本文来自博客园,作者:花之旭,转载请注明原文链接:https://www.cnblogs.com/huazhixu/p/16522716.html