以mysql-noinstall-5.0.22为例
1、下载mysql-noinstall-5.0.22.zip
2、解压mysql-noinstall-5.0.22.zip到D盘根目录下D:\mysql-5.0.22\
3、D:\mysql-5.0.22\目录下新建一个my.ini,拷贝my-small.ini代码至my.ini。添加部分代码
# Example MySQL config file for small systems.
#
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /usr/local/var) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options will be passed to all MySQL clients
[client]
#设置mysql客户端的字符集
default-character-set=gbk
password = 123456
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
#设置mysql服务器的字符集,默认编码
default-character-set=gbk
#设置mysql的安装目录
basedir=D:/mysql-5.0.22
#设置mysql数据库的数据的存放目录,必须是data
datadir=D:/mysql-5.0.22/data
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
server-id = 1
# Uncomment the following if you want to log updates
#log-bin=mysql-bin
# Uncomment the following if you are NOT using BDB tables
#skip-bdb
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /usr/local/var/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /usr/local/var/
#innodb_log_arch_dir = /usr/local/var/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
key_buffer = 8M
sort_buffer_size = 8M
[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M
[mysqlhotcopy]
interactive-timeout
4、编写启动脚本startup.bat,放在D:\mysql-5.0.22\bin路径下
@echo off
echo start mysql5 on localhost
mysqld --install mysql5 --defaults-file=D:\mysql-5.0.22\my.ini
net start mysql5
pause
5、编写停止脚本stop.bat放在D:\mysql-5.0.22\bin路径下
@echo off
echo stop mysql5
net stop mysql5
mysqld --remove mysql5
pause
6、配置完毕后,双击D:\mysql-5.0.22\bin路径下的startup.bat批处理文件,既可以将mysql5注册到系统服务中,并且已经启动。
注意:如果是win7操作系统,不能直接运行,由于win7对权限更加严格,会出现
start mysql5 on localhost
Install/Remove of the Service Denied!
发生系统错误 5。
需要点击右键“以管理员身份运行”
7、查看数据库情况,如
D:\mysql-5.0.22\bin>mysqlshow -u root mysql //查看mysql database
+---------------------------+
| Tables |
+---------------------------+
| columns_priv |
| db |
| func |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| proc |
| procs_priv |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
8、修改root密码为123456,密码默认为空
mysql存储用户和密码放置于mysql数据库的use表里,你可以通过下面命令直接修改其密码
$ mysql -u root -p #--登录mysql 服务器
mysql> use mysql; #使用mysql数据库
mysql> update user set password=PASSWORD("123456") where User='root'; #--更新用户密码
mysql>flush privileges; #--重新刷新权限
mysql> quit #--退出mysql服务器
9、over
分享到:
相关推荐
MySQL免安装版配置步骤,可以让你不用安装就可以使用MySQL
MySQL免安装版配置,文档.精心整理!
MySQL免安装版配置步骤图解[归纳].pdf
Windows下mysql免安装版配置与使用方法,详细讲述mysql的安装常见问题。
mysql免安装自动配置启动文件 启动mysql和关闭文件 放入mysql解压缩文件之后的bin文件夹
主要介绍了mysql免安装版配置步骤详解,提供了二个网友的安装方法,大家可以参考使用
免安装版 mysql 免安装版本配置方法 详细步骤一步一步完成mysql的安装和使用 [mysql] #设置mysql客户端默认字符集 default-character-set=utf8 [mysqld] #设置3306端口 port = 3306 #设置mysql的安装目录 basedir=D:...
mysql免安装设置
免安装版的mysql配置文档,本人已经用过了,多种方法没问题。
Window下MySQL5.7 免安装版配置
主要介绍了mysql免安装版配置与修改密码的教程详解,需要的朋友可以参考下
1. 官网直接下载MySql免安装压缩包。我安装的是·mysql-8.0.29` 2. 解压压缩包到一个文件夹下F:\Program Files\mysql-8.0.29-winx64 3. 在mysql-8.0.29-winx64文件夹下创建一个Data文件夹 4. 在mysql-8.0.29-winx64...
资源名称:Linux MySQL免安装及配置资源截图: 资源太大,传百度网盘了,链接在附件中,有需要的同学自取。
mysql 5.7免安装版图文详细教程与博客参考,出现**发生系统错误2**解决方法,设置端口、生成无密码root用户等
本文实例为大家分享了mysql免安装版配置教程,供大家参考,具体内容如下 1.下载MySQL免安装版压缩包,并减压到自定义目录,比如:D:\program0\mysql (以下以该目录为例) 2.修改my.ini文件(可能是my-default.ini...
my-default.ini相关,mysql免安装版本的配置相关,更多相关配置可以参考个人博客
mysql8.0.13免安装版配置操作步骤 包括ini的设置 程序中怎么配置
MySQL5.5(64位,32位)免安装版 + 全自动智能配置软件。 压缩包里面提供了MYSQL5.5的64位版,32位版,无需进行安装。 以前用别人的CDM命令脚本,或多或少都有点错误,而且脚本是分开的,很麻烦!所以自己做了个工具。 ...