1、解压文件,例如:置于E:\Program Files\mysql-5.7.24-winx64,新建my.ini ,内容如下:
[mysqld]
# 设置为自己MYSQL的安装目录
basedir=E:\Program Files\mysql-5.7.24-winx64
# 设置为MYSQL的数据目录
datadir=E:\Program Files\mysql-5.7.24-winx64\data
port=3306
character_set_server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER
#开启查询缓存
explicit_defaults_for_timestamp=true
#skip-grant-tables
新建data文件夹;
2、环境变量中,配置path:;E:\Program Files\mysql-5.7.24-winx64\bin;
3、cmd管理员身份打开,定位到E:\Program Files\mysql-5.7.24-winx64\bin下,执行命令:
显示服务创建成功。服务名默认为mysql;
4、获取初始密码,执行命令:
mysqld --initialize --user=mysql --console
记录末尾的密码,初次登陆时使用,例如:localhost: x;4aCuXaUHx-;
5、启动服务,执行命令:
6、登陆mysql:
输入步骤4中的密码,登陆成功;
7、设置默认密码,依次输入下列命令:
use mysql;
alter user 'root'@'localhost' identified by 'mysql';
SET PASSWORD = PASSWORD('123456');
flush privileges;
8、连接MySql-Front提示异常信息The'INFORMATION_SCHEMA.SESSION_VARIABLES' feature is disabled; see thedocumentation for 'show_compatibility_56',执行如下代码:
MySQL> select * from information_schema.global_status limit 3;
ERROR 3167 (HY000): The 'INFORMATION_SCHEMA.GLOBAL_STATUS' feature is disabled; see the documentation for 'show_compatibility_56'
--查看show_compatibility_56其值
MySQL> show variables like '%show_compatibility_56%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| show_compatibility_56 | OFF |
+-----------------------+-------+
1 row in set (0.01 sec)
--把show_compatibility_56打开
mysql> set global show_compatibility_56=on;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like '%show_compatibility_56%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| show_compatibility_56 | ON |
+-----------------------+-------+
1 row in set (0.00 sec)
mysql> select * from information_schema.global_status limit 3;
+-----------------------+----------------+
| VARIABLE_NAME | VARIABLE_VALUE |
+-----------------------+----------------+
| ABORTED_CLIENTS | 0 |
| ABORTED_CONNECTS | 0 |
| BINLOG_CACHE_DISK_USE | 0 |
+-----------------------+----------------+
3 rows in set, 1 warning (0.00 sec)
|