mysql在我的windows的安装

1.下载安装包

2.解压,配置到path环境变量中.

3.配置my.ini文件

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.


[mysqld]
character-set-server=utf8
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M


# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin


# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....


basedir=D:/apps/mysql-5.7.11-winx64
datadir=D:/apps/mysql-5.7.11-winx64/data/mysql/
port=13306


character-set-server=utf8
default-storage-engine=INNODB
innodb_data_home_dir=D:/apps/mysql-5.7.11-winx64/data
innodb_data_file_path=ibdata1:12M:autoextend
innodb_log_group_home_dir=D:/apps/mysql-5.7.11-winx64/data


innodb_buffer_pool_size=512M
innodb_log_file_size=1G




# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 


# sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
 4.mysql的初始化

mysqld --initialize --explicit_defaults_for_timestamp --user=mysql

如果不执行则会出现如下错:

2016-03-06T00:19:34.727747Z 0 [ERROR] Fatal error: Can't open and lock privilege
 tables: Table 'mysql.user' doesn't exist
2016-03-06T00:19:34.730748Z 0 [ERROR] Aborting

5.mysqld -install

6.启动my sql :

net start mysql

D:\apps\mysql-5.7.11-winx64\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

7.set  skip grand in my.ini file;

skip-grant-tables

8.reset the password of root user 

update user set authentication_string=password('12345') where user='root';

9.restart mysql service.

login success:

D:\apps\mysql-5.7.11-winx64\bin>mysql -uroot -p
Enter password: *****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.11


Copyright (c) 2000, 2016, 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> SET PASSWORD = PASSWORD('123456'); 
Query OK, 0 rows affected (0.03 sec) 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值