绿色版mysql安装配置
2023-06-13 09:14:10 时间
一、下载MySQL
http://www.mysql.org/downloads
我下载的是mysql-noinstall-5.0.67-win32.zip
1、解压缩
假定
#ExampleMySQLconfigfileformediumsystems.
#
#Thisisforasystemwithlittlememory(32M-64M)whereMySQLplays
#animportantpart,orsystemsupto128MwhereMySQLisusedtogetherwith
#otherprograms(suchasawebserver)
#
#Youcancopythisfileto
#/etc/my.cnftosetglobaloptions,
#mysql-data-dir/my.cnftosetserver-specificoptions(inthis
#installationthisdirectoryisC:\mysql\data)or
#~/.my.cnftosetuser-specificoptions.
#
#Inthisfile,youcanusealllongoptionsthataprogramsupports.
#Ifyouwanttoknowwhichoptionsaprogramsupports,runtheprogram
#withthe"--help"option.
#ThefollowingoptionswillbepassedtoallMySQLclients
[client]
#password =your_password
port =3306
socket =/tmp/mysql.sock
#Herefollowsentriesforsomespecificprograms
#TheMySQLserver
[mysqld]
basedir="C:\MySQL5"
datadir="C:\MySQL5\data"
default-character-set=utf8
port =3306
socket =/tmp/mysql.sock
skip-locking
key_buffer=16M
max_allowed_packet=1M
table_cache=64
sort_buffer_size=512K
net_buffer_length=8K
read_buffer_size=256K
read_rnd_buffer_size=512K
myisam_sort_buffer_size=8M
#Don"tlistenonaTCP/IPportatall.Thiscanbeasecurityenhancement,
#ifallprocessesthatneedtoconnecttomysqldrunonthesamehost.
#AllinteractionwithmysqldmustbemadeviaUnixsocketsornamedpipes.
#NotethatusingthisoptionwithoutenablingnamedpipesonWindows
#(viathe"enable-named-pipe"option)willrendermysqlduseless!
#
#skip-networking
#DisableFederatedbydefault
skip-federated
#ReplicationMasterServer(default)
#binaryloggingisrequiredforreplication
log-bin=mysql-bin
#requireduniqueidbetween1and2^32-1
#defaultsto1ifmaster-hostisnotset
#butwillnotfunctionasamasterifomitted
server-id =1
#ReplicationSlave(commentoutmastersectiontousethis)
#
#Toconfigurethishostasareplicationslave,youcanchoosebetween
#twomethods:
#
#1)UsetheCHANGEMASTERTOcommand(fullydescribedinourmanual)-
# thesyntaxis:
#
# CHANGEMASTERTOMASTER_HOST=<host>,MASTER_PORT=<port>,
# MASTER_USER=<user>,MASTER_PASSWORD=<password>;
#
# whereyoureplace<host>,<user>,<password>byquotedstringsand
# <port>bythemaster"sportnumber(3306bydefault).
#
# Example:
#
# CHANGEMASTERTOMASTER_HOST="125.564.12.1",MASTER_PORT=3306,
# MASTER_USER="joe",MASTER_PASSWORD="secret";
#
#OR
#
#2)Setthevariablesbelow.However,incaseyouchoosethismethod,then
# startreplicationforthefirsttime(evenunsuccessfully,forexample
# ifyoumistypedthepasswordinmaster-passwordandtheslavefailsto
# connect),theslavewillcreateamaster.infofile,andanylater
# changeinthisfiletothevariables"valuesbelowwillbeignoredand
# overriddenbythecontentofthemaster.infofile,unlessyoushutdown
# theslaveserver,deletemaster.infoandrestarttheslaverserver.
# Forthatreason,youmaywanttoleavethelinesbelowuntouched
# (commented)andinsteaduseCHANGEMASTERTO(seeabove)
#
#requireduniqueidbetween2and2^32-1
#(anddifferentfromthemaster)
#defaultsto2ifmaster-hostisset
#butwillnotfunctionasaslaveifomitted
#server-id =2
#
#Thereplicationmasterforthisslave-required
#master-host = <hostname>
#
#Theusernametheslavewilluseforauthenticationwhenconnecting
#tothemaster-required
#master-user = <username>
#
#Thepasswordtheslavewillauthenticatewithwhenconnectingto
#themaster-required
#master-password= <password>
#
#Theportthemasterislisteningon.
#optional-defaultsto3306
#master-port = <port>
#
#binarylogging-notrequiredforslaves,butrecommended
#log-bin=mysql-bin
#Pointthefollowingpathstodifferentdedicateddisks
#tmpdir =/tmp/
#log-update =/path-to-dedicated-directory/hostname
#UncommentthefollowingifyouareusingBDBtables
#bdb_cache_size=4M
#bdb_max_lock=10000
#UncommentthefollowingifyouareusingInnoDBtables
#innodb_data_home_dir=C:\mysql\data/
#innodb_data_file_path=ibdata1:10M:autoextend
#innodb_log_group_home_dir=C:\mysql\data/
#innodb_log_arch_dir=C:\mysql\data/
#Youcanset.._buffer_pool_sizeupto50-80%
#ofRAMbutbewareofsettingmemoryusagetoohigh
#innodb_buffer_pool_size=16M
#innodb_additional_mem_pool_size=2M
#Set.._log_file_sizeto25%ofbufferpoolsize
#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
#RemovethenextcommentcharacterifyouarenotfamiliarwithSQL
#safe-updates
[isamchk]
key_buffer=20M
sort_buffer_size=20M
read_buffer=2M
write_buffer=2M
[myisamchk]
key_buffer=20M
sort_buffer_size=20M
read_buffer=2M
write_buffer=2M
[mysqlhotcopy]
interactive-timeout
[mysqld]
#设置mysql的安装目录
basedir=$MYSQL_HOME
#设置mysql数据库的数据的存放目录,必须是data,或者是\\xxx\data
datadir=$MYSQL_HOME\data
#设置mysql服务器的字符集
default-character-set=utf8
[client]
#设置mysql客户端的字符集
default-character-set=gbk
3、安装mysql服务
从MS-DOS窗口进入目录E:\myserver\mysql-5.0.37-win32\bin,运行如下命令:
mysqld--installmysql--defaults-file=C:\MySQL5\my.ini
4、启动mysql数据库
还在上面的命令窗口里面,输入命令:netstartmysql
这样就启动了mysql服务。
5、停止服务
执行netstopmysql即可
6、删除服务
执行mysqld--removemysql即可
执行mysqld--removemysql即可
7、修改密码
以上安装完毕之后,默认的root用户密码为空的。为了安全起见,需要设置一个root用户的密码。
<STRONG><SPANstyle="COLOR:#ffffff"style="COLOR:#ffffff">C:\>cdMySQL5
C:\MySQL5>cdbin
C:\MySQL5\bin>mysql-uroot-p
Enterpassword:
WelcometotheMySQLmonitor. Commandsendwith;or\g.
YourMySQLconnectionidis3
Serverversion:5.0.67-community-logMySQLCommunityEdition(GPL)
Type"help;"or"\h"forhelp.Type"\c"toclearthebuffer.
mysql>usemysql
Databasechanged
mysql>updateUsersetPassword=PASSWORD("admin")whereUser="root";
QueryOK,2rowsaffected(0.08sec)
Rowsmatched:2 Changed:2 Warnings:0</SPAN>
</STRONG>
相关文章
- Ubuntu安装配置MySQL_nginx upstream
- 体验MySQL企业版:安装与体验(mysql企业版安装)
- MySQL主从配置实现高可用(mysql主从高可用)
- 安装MySQL的Chroot安装:跨界自由飞翔(mysql的chroot)
- MySQL 高级优化:提升数据库性能的秘籍(mysql高级优化)
- 深入理解MySQL主主同步配置(mysql主主同步配置)
- 如何轻松配置MySQL服务,快速搭建数据库环境(如何配置mysql服务)
- MySQL双主配置教程分享:打造高可用数据库系统(mysql双主配置)
- MySQL压缩包如何安装(mysql压缩包如何安装)
- Mysql必知必会:不可不下载的利器(mysql必知必会 下载)
- MySQL:拥有何种威力?(mysql 多大)
- 如何使用CMD查找MySQL安装路径(cmd查找mysql路径)
- MySQL 57 版本安装指南(5.7版本mysql安装)
- CMake下载MySQL极速安装体验(cmake下载mysql)
- MySQL CE轻松学习开源数据库的利器(mysql_ce)
- 如何在不卸载MySQL的情况下直接安装新版本(mysql不卸载直接安装)
- MySQL服务不停,如何进行扩容(mysql 不停服务扩容)
- MySQL的非严谨模式对数据库管理的重要影响(mysql 不严谨模式)
- MySQL下载与安装简单易上手的25步教程(mysql下载及安装步骤)