Win7下安装Mysql方法
时间:2021-07-01 10:21:17
帮助过:2人阅读
//dev.mysql.com/doc/refman/5.6/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.
[client]
default-character-
set=
utf8
[mysql]
default-character-
set=
utf8
[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 = D:/mysql-
5.6.
16-
winx64
datadir = D:/mysql-
5.6.
16-winx64/
data
# 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
2.2 安装mysql
以管理员身份启动cmd,切换到目录D:/mysql-5.6.12-win32/bin
安装mysql:mysqld.exe --install(CMD中执行后,如果报拒绝,则需要用管理员权限运行CMD,然后执行该命令)
三、启动mysql服务
3.1 启动mysql服务
以管理员身份启动cmd,切换到目录D:/mysql-5.6.12-win32/bin
启动mysql服务:net start MySQL
(若想在cmd命令中直接运行指令,而不用进入bin目录下,需要在环境变量中增加路径,如图:
)
PS:系统默认的Mysql是自启动的,修改为手工启动的方法:
进入本机的“服务”,修改为手动启动即可,如图:
四、执行命令
4.1 登录mysql
mysql -u root -p
输入密码(密码为空,直接回车),即可登录。
修改root密码为123456:
mysql> use mysql;
Database changed
mysql> UPDATE user SET password=PASSWORD("123456") WHERE user=‘root‘;
4.2 执行mysql命令
五、卸载mysql
4.1 停止mysql服务
net stop MySQL
4.2 卸载mysql
mysqld.exe --remove
Win7下安装Mysql方法
标签: