mysql免安装版装备ITeye - 千亿集团

mysql免安装版装备ITeye

2019年02月18日10时05分13秒 | 作者: 思真 | 标签: 设置,效劳,数据库 | 浏览: 1552

 

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 its important that the mysqld daemon
# doesnt 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
# Dont 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

 

版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表千亿集团立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章

阅读排行

  • 1

    mysql免安装版装备ITeye

    设置,效劳,数据库
  • 2
  • 3

    按要求写sql句子itjob

    句子,学员,课程
  • 4

    检查数据库的SQL快报

    检查,数据库,检查表
  • 5

    DB2 备份和康复huabian

    康复,备份,数据库
  • 6

    运用MySQL头条

    运用,问题,效劳
  • 7
  • 8

    DATA PUMPfenghuang

    简略,指令,数据
  • 9

    Oracle Dimension 下alibaba

    邮编,区域,月度
  • 10

    Oracle失望锁和达观锁ITeyecsdn

    数据,时分,数据库