mysql解压版安装

1、 解压后,将mysql添加到环境变量path:

D:Javamysql

2、修改my-default.ini 文件

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


# 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 
#服务端的编码方式
character-set-server=utf8
[client]
#客户端编码方式,最好和服务端保存一致
loose-default-character-set = utf8

3、安装mysql服务:

命令:mysqld -install

4、启动MySQL服务:

net start mysql

5、登录mysql:

执行“mysql -u root -p”,提示输入密码,由于第一次运行,密码为空可以直接回车。

6、设置root密码:

这个命令在mysql的bin下执行,命令输完后回车,再提提示输入密码,是让输入旧密码,旧密码为空,直接回车就可以。

命令:mysqladmin -u root -p password <新密码>

7、测试新密码连接:

原文地址:https://www.cnblogs.com/hoge/p/5004415.html