码迷,mamicode.com
首页 > 数据库 > 详细

免安装mysql--参考文章

时间:2018-09-08 13:08:41      阅读:228      评论:0      收藏:0      [点我收藏+]

标签:uniq   port   ibdata1   mysql\   sql   lock   lte   upd   generate   

[client]
port		= 3306
socket		= D:\\ProgramData\\MySQL\\tmp\\mysql.sock
#default-character-set=utf8mb4
character_sets_dir = C:/mysql/share/charsets
[mysqld]
port		= 3306
socket		= D:\\ProgramData\\MySQL\\tmp\\mysql.sock
pid_file = D:\\ProgramData\\MySQL\\run\\mysql.pid
basedir = C:\\mysql
datadir = D:\\ProgramData\\MySQL\\data
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
 
default-storage-engine = InnoDB
# 从8.0 开始,mysql默认字符集为utf8mb4
character_set_server = utf8mb4
character_sets_dir = C:/mysql/share/charsets
 
tmpdir		= D:\\ProgramData\\MySQL\\tmp\ 
 
log-bin=D:\\ProgramData\\MySQL\\logs\\mysql-bin
#bin log 过期时间 按秒记,即14*24*60*60 秒
binlog_expire_logs_seconds = 1209600
# binary logging format - mixed recommended
binlog_format=row
 
#expire_logs_days= 7
 
log-error = D:\\ProgramData\\MySQL\\logs\\error.log
 
 
slow-query-log = 1
long_query_time= 3
slow_query_log_file= D:\\ProgramData\\MySQL\\logs\\slow.log
 
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id	= 1
 
 
# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = D:\\ProgramData\\MySQL\\data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = D:\\ProgramData\\MySQL\\logs
# 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
 
innodb_file_per_table = 1
 
[mysqldump]
quick
max_allowed_packet = 16M
 
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
 
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
 
[mysqlhotcopy]
interactive-timeout

基本my.ini配置如上图

cmd 进入 安装目录执行

1. mysqld.exe --initialize  --basedir=mysql安装目录 --datadir=自建的data数据存放目录

2. mysqld.exe --defaults-file="mysql目录/my.ini" --console

3. 执行完成后 在data下有一个.err结尾的文件 其中有一行 格式 :[Server] A temporary password is generated for root@localhost: agEE;3)a(+LR

4.在打开一个cmd  mysql -uroot -pagEE;3)a(+LR(红色为系统给的随机密码各不相同)

5.修改密码 alter user ‘root’@‘localhost’ identified by “新密码”

 

   

免安装mysql--参考文章

标签:uniq   port   ibdata1   mysql\   sql   lock   lte   upd   generate   

原文地址:https://www.cnblogs.com/baiyunpeng/p/9608869.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!