mysql解压版安装步骤

1.下载解压版mysql

mysql-5.7.18-winx64.zip

2.自定义安装路径

自己安装路径
F:myinstallmysqlmysql-5.7.18-winx64
mysql解压版安装步骤_第1张图片

3.手动在bin目录下创建my.ini文件

F:myinstallmysqlmysql-5.7.18-winx64in
mysql解压版安装步骤_第2张图片

3.1 修改my.ini文件

修改内容:
basedir =“F:myinstallmysqlmysql-5.7.18-winx64”
datadir =“F:myinstallmysqlmysql-5.7.18-winx64”data"
tmpdir =“F:myinstallmysqlmysql-5.7.18-winx64”data"
socket =“F:myinstallmysqlmysql-5.7.18-winx64”datamysql.sock"
log-error=“F:myinstallmysqlmysql-5.7.18-winx64”
innodb_data_home_dir=“F:myinstallmysqlmysql-5.7.18-winx64”data"

将以上需要修改的内容改为自己安装的mysql路径即可

client]
port=3306
default-character-set=utf8
 
[mysqld]
bind-address = 127.0.0.1
port=3306
character_set_server=utf8
basedir ="F:myinstallmysqlmysql-5.7.18-winx64"
datadir ="F:myinstallmysqlmysql-5.7.18-winx64"data"
tmpdir ="F:myinstallmysqlmysql-5.7.18-winx64"data"
socket ="F:myinstallmysqlmysql-5.7.18-winx64"datamysql.sock"
log-error="F:myinstallmysqlmysql-5.7.18-winx64"datamysql_error.log"
 
max_connections=100
table_open_cache=256
query_cache_size=1M
tmp_table_size=32M
thread_cache_size=8
 
innodb_data_home_dir="F:myinstallmysqlmysql-5.7.18-winx64"data"
innodb_flush_log_at_trx_commit =1
innodb_log_buffer_size=128M
innodb_buffer_pool_size=128M
innodb_log_file_size=10M
innodb_thread_concurrency=16
innodb-autoextend-increment=1000
 
join_buffer_size = 128M
sort_buffer_size = 32M
read_rnd_buffer_size = 32M
max_allowed_packet = 32M
explicit_defaults_for_timestamp=true
 
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

3.2创建data数据存储文件

在F:myinstallmysqlmysql-5.7.18-winx64目录下新建data文件夹,必须为空
mysql解压版安装步骤_第3张图片

4.配置mysql环境变量

mysql解压版安装步骤_第4张图片mysql解压版安装步骤_第5张图片

5.使用系统管理员方式cmd到mysql安装路径

1.在电脑左边找到命令提示符

mysql解压版安装步骤_第6张图片

2.执行如下命令

mysqld.exe -install


mysqld --initialize-insecure


mysqld -install

在这里插入图片描述

6.win10开启自动启动mysql服务

进入mysql安装页面的bin目录下,输入“mysqld.exe --install”
可以看到输出结果为:

mysqld.exe --install

Service successfully installed.

7.启动mysql服务net start mysql

net start mysql

在这里插入图片描述

7.1查看mysql是否启动成功

mysql解压版安装步骤_第7张图片

7.2查看mysql是否启动成功

安装成功还没设置密码回车即可
mysql解压版安装步骤_第8张图片

Mysql5.7.18修改密码

7.1 进入mysql执行如下修改密码

mysql解压版安装步骤_第9张图片

update user set password=password("123456") where user="root";
update mysql.user set authentication_string=password('123456') where user='root';



mysql> select user from user;
+-----------+
| user      |
+-----------+
| mysql.sys |
| root      |
+-----------+
2 rows in set (0.00 sec)

mysql> update user set password=password("123456") where user="root";
ERROR 1054 (42S22): Unknown column 'password' in 'field list'# 修改报错
mysql> update mysql.user set authentication_string=password('123456') where user='root'; # 再执行修改成功
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1

mysql> flush privileges; # 刷新权限
Query OK, 0 rows affected (0.00 sec)

mysql> quit;# 退mysql
Bye

C:Usersjkl>

7.2 重新进入mysql

发现不输入密码,直接报错,输入密码后直接进入mysql了

C:Usersjkl>mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

C:Usersjkl>mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 7
Server version: 5.7.18 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, 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>

最后

深知大多数初中级Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则近万的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《Java开发全套学习资料》送给大家,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。

小编已加密:aHR0cHM6Ly9kb2NzLnFxLmNvbS9kb2MvRFVrVm9aSGxQZUVsTlkwUnc==出于安全原因,我们把网站通过base64编码了,大家可以通过base64解码把网址获取下来。

你可能感兴趣的:(面试,学习路线,阿里巴巴,mysql,数据库,java,算法,开发语言)