mysql免安装版安装简要

数据库 1473 0 2015-09-09

mysql免安装版安装简要

解压出下载的文件mysql-5.6.24-win32.zip(有x86和x64两个版本)到任一目录,防止出现未知问题,最好放在非系统盘的非中文目录下,我的位置D:\mysql。打开文件夹复制一份my-default.ini为my.ini的配置文件。

配置文件my.ini参考:
************************************************

# For advice on how to change settings please see

# http://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.

 

[mysqld]

 

# 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"

datadir = "D:\mysql\data"

port = 3306

# 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

 

 [WinMySQLadmin]  

 Server = "D:\mysql\bin\mysqld.exe"


************************************************

安装MYSQL:
开始——运行——cmd,然后cd到mysql安装目录的bin下面,我的目录就是“D:\mysql\bin”,然后执行mysqld -install,提示服务安装成功!

 

设置root密码:

由于一开始root密码是空的,所以第一次可以这样设置密码,代码:

mysqladmin -u root -p password 123456

输入以上代码后按回车,提示输入密码,因为原来root为空的,所以这里直接按回画即可。

 

删除MYSQL:

mysqld --remove

 

-----------------------------------------------------------------------

注:以上操作均在mysql安装目录的bin目录下进行。

-----------------------------------------------------------------------

 

MYSQL启动或停止:

开始->运行->cmd
停止:net stop mysql
启动:net start mysql
前提MYSQL已经安装为windows服务

上一篇:数据库 CHECKDB 发现了x个分配错误和 x 个一致性错误

下一篇:MYSQL:Got error 175 from storage engine 数据库提示错误,需要修复

讨论数量:1

天涯网魂 3 杠 5 星2015-09-09 10:05:26

绿色版mysql注册卸载服务方法

如果直接用绿色版的mysql,则下载后解压,只需对目录下的my.ini文件的basedir(mysql的基本目录)和datadir(mysql数据目录)指定就可以,如下所示。

#Path to installation directory. All paths are usually resolved relative to this.
basedir="D:\MySQL Server 5.1/"
#Path to the database root
datadir="D:\MySQL Server 5.1/Data/"
但是因为免安装,所以不会生成服务,只需通过简单的命令就可以实现:

打开命令窗口切换到mysql的bin目录下。

 

1.注册服务:
D:\MySQL Server 5.1\bin>mysqld --install
回车执行,会提示创建成功,打开服务可以找到刚创建的mysql51服务

2.卸载服务:
D:\MySQL Server 5.1\bin>mysqld --remove

请先登录再发表讨论。 2024-04-26

天涯网魂
3 杠 5 星
TA 的文章
TA 的随言
TA 的资源链