1,環境變量。
html
2,ini文件修改mysql
[mysql]sql
default-character-set=utf8ui
# For advice on how to change settings please see加密
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.htmlspa
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to theorm
# *** default location during install, and will be replaced if youserver
# *** upgrade to a newer version of MySQL.htm
[mysqld]rem
character-set-server=utf8
basedir=D:\mysql-5.6.24-win32
datadir=D:\mysql-5.6.24-win32\data
# 容許最大鏈接數
max_connections = 200
# 設置字符集爲utf8
loose-default-character-set = utf8
#bind-address = 0.0.0.0
# 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 = .....
# 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
3,
bin 進入mysql的bin文件夾(無論有沒有配置過環境變量,也要進入bin文件夾,不然以後啓動服務仍然會報錯誤2)
輸入mysqld -install
4,修改密碼:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
密碼加密:
select password('你想輸入的密碼');