mysql 应用 持续更新

1.安装方法

贴出,my.ini

# MySQL Server Instance Configuration File
# ----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
# ----------------------------------------------------------------------
#
# On Linux you can copy this file to /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options
# (@[email protected] for this installation) or to
# ~/.my.cnf to set user-specific options.
#
# On Windows you should keep this file in the installation directory
# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
# make sure the server reads the config file use the startup option
# "--defaults-file".
#
# To run run the server from the command line, execute this in a
# command line shell, e.g.
# mysqld --defaults-file="C:\Program Files\MySQL\MySQL Server X.Y\my.ini"
#
# To install the server as a Windows service manually, execute this in a
# command line shell, e.g.
# mysqld --install MySQLlng --defaults-file="d:\mydeploy\mysqllng\my.ini"
#
# And then execute this in a command line shell to start the server, e.g.
# net start MySQLXY
#
#
# Guildlines for editing this file
# ----------------------------------------------------------------------
#
# In this file, you can use all long options that the program supports.
# If you want to know the options a program supports, start the program
# with the "--help" option.
#
# More detailed information about the individual options can also be
# found in the manual.
#
#
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]

port=3319

[mysql]

default-character-set=utf8

# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
[mysqld]

# The TCP/IP Port the MySQL Server will listen on
port=3319

#Path to installation directory. All paths are usually resolved relative to this.
basedir="D:/mydeploy/mysqllng/"

#Path to the database root
datadir="D:/mydeploy/mysqllng/data/"

# The default character set that will be used when a new schema or table is
# created and no character set is defined
character-set-server=utf8

# The default storage engine that will be used when create new tables when
default-storage-engine=INNODB

# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

# The maximum amount of concurrent sessions the MySQL server will
# allow. One of these connections will be reserved for a user with
# SUPER privileges to allow the administrator to login even if the
# connection limit has been reached.
max_connections=100

# Query cache is used to cache SELECT results and later return them
# without actual executing the same query once again. Having the query
# cache enabled may result in significant speed improvements, if your
# have a lot of identical queries and rarely changing tables. See the
# "Qcache_lowmem_prunes" status variable to check if the current value
# is high enough for your load.
# Note: In case your tables change very often or if your queries are
# textually different every time, the query cache may result in a
# slowdown instead of a performance improvement.
query_cache_size=100M

# The number of open tables for all threads. Increasing this value
# increases the number of file descriptors that mysqld requires.
# Therefore you have to make sure to set the amount of open files
# allowed to at least 4096 in the variable "open-files-limit" in
# section [mysqld_safe]
table_cache=256

# Maximum size for internal (in-memory) temporary tables. If a table
# grows larger than this value, it is automatically converted to disk
# based table This limitation is for a single table. There can be many
# of them.
tmp_table_size=103M

# How many threads we should keep in a cache for reuse. When a client
# disconnects, the client‘s threads are put in the cache if there aren‘t
# more than thread_cache_size threads from before.  This greatly reduces
# the amount of thread creations needed if you have a lot of new
# connections. (Normally this doesn‘t give a notable performance
# improvement if you have a good thread implementation.)
thread_cache_size=8

#*** MyISAM Specific options

# The maximum size of the temporary file MySQL is allowed to use while
# recreating the index (during REPAIR, ALTER TABLE or LOAD DATA INFILE.
# If the file-size would be bigger than this, the index will be created
# through the key cache (which is slower).
myisam_max_sort_file_size=100G

# If the temporary file used for fast index creation would be bigger
# than using the key cache by the amount specified here, then prefer the
# key cache method.  This is mainly used to force long character keys in
# large tables to use the slower key cache method to create the index.
myisam_sort_buffer_size=205M

# Size of the Key Buffer, used to cache index blocks for MyISAM tables.
# Do not set it larger than 30% of your available memory, as some memory
# is also required by the OS to cache rows. Even if you‘re not using
# MyISAM tables, you should still set it to 8-64M as it will also be
# used for internal temporary disk tables.
key_buffer_size=16M

# Size of the buffer used for doing full table scans of MyISAM tables.
# Allocated per thread, if a full scan is needed.
read_buffer_size=64K
read_rnd_buffer_size=256K

# This buffer is allocated when MySQL needs to rebuild the index in
# REPAIR, OPTIMZE, ALTER table statements as well as in LOAD DATA INFILE
# into an empty table. It is allocated per thread so be careful with
# large settings.
sort_buffer_size=256K

#*** INNODB Specific options ***

# Use this option if you have a MySQL server with InnoDB support enabled
# but you do not plan to use it. This will save memory and disk space
# and speed up some things.
#skip-innodb

# Additional memory pool that is used by InnoDB to store metadata
# information.  If InnoDB requires more memory for this purpose it will
# start to allocate it from the OS.  As this is fast enough on most
# recent operating systems, you normally do not need to change this
# value. SHOW INNODB STATUS will display the current amount used.
innodb_additional_mem_pool_size=12M

# If set to 1, InnoDB will flush (fsync) the transaction logs to the
# disk at each commit, which offers full ACID behavior. If you are
# willing to compromise this safety, and you are running small
# transactions, you may set this to 0 or 2 to reduce disk I/O to the
# logs. Value 0 means that the log is only written to the log file and
# the log file flushed to disk approximately once per second. Value 2
# means the log is written to the log file at each commit, but the log
# file is only flushed to disk approximately once per second.
innodb_flush_log_at_trx_commit=1

# The size of the buffer InnoDB uses for buffering log data. As soon as
# it is full, InnoDB will have to flush it to disk. As it is flushed
# once per second anyway, it does not make sense to have it very large
# (even with long transactions).
innodb_log_buffer_size=6M

# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
# row data. The bigger you set this the less disk I/O is needed to
# access data in tables. On a dedicated database server you may set this
# parameter up to 80% of the machine physical memory size. Do not set it
# too large, though, because competition of the physical memory may
# cause paging in the operating system.  Note that on 32bit systems you
# might be limited to 2-3.5G of user level memory per process, so do not
# set it too high.
innodb_buffer_pool_size=579M

# Size of each log file in a log group. You should set the combined size
# of log files to about 25%-100% of your buffer pool size to avoid
# unneeded buffer pool flush activity on log file overwrite. However,
# note that a larger logfile size will increase the time needed for the
# recovery process.
innodb_log_file_size=116M

# Number of threads allowed inside the InnoDB kernel. The optimal value
# depends highly on the application, hardware as well as the OS
# scheduler properties. A too high value may lead to thread thrashing.
innodb_thread_concurrency=8

安装服务,我的mysql bin目录是D:\mydeploy\mysqllng\bin

D:\mydeploy\mysqllng\bin\mysqld -install gfscn --defaults-file="D:\mydeploy\mysqllng\bin\my.ini"

启动服务

net start gfscn

停止服务

net stop gfscn

删除服务

D:\mydeploy\mysqllng\bin\mysqld -remove gfscn

修改数据库密码

以root用户登录,命令:mysql -uroot -p 回车 输入密码;mysql>use mysql;mysql>UPDATE user SET password=PASSWORD(‘输入新密码‘) WHERE user=‘root‘;mysql>FLUSH PRIVILEGES;
时间: 2024-10-13 01:12:57

mysql 应用 持续更新的相关文章

关于MYSQL优化(持续更新)

*利用MYSQL数据缓存提高效率,注意事项: 1.应用环境:不经常改变的表及对此表相同的查询 2.不适用于服务器端编写的语句 3.根据数据使用频率,合理分解表 4.合理使用默认条件,提高命中率 5.统一SQL语句编写规范,因为MYSQL解析时区分大小写 6.增加服务器缓存空间 *为查询缓存,优化查询语句: // 查询缓存不开启 $r = mysql_query("SELECT username FROM user WHERE signup_date >= CURDATE()");

mysql 应用 持续更新2 转载

作者:彼岸Queen旅行链接:https://www.zhihu.com/question/27334963/answer/266624031来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处. 使用WAMP的MySql控制台修改. (1)打开WAMP的mysql控制台,提示输入密码,开始密码为空,直接按回车 (2)输入[use mysql],控制台提示[Database changed] (3)输入[update user set password=PASSWORD(

MySQL乱码收集_持续更新

1.在mysql中执行下句成功,可添加中文的. insert into book(bookName,author,publish) values('好','hao','hao'); 但是在jsp中执行这个insert 语句就会出现乱码. 解决方案:在url后面加上?useUnicode=true&characterEncoding=utf-8 2.导入txt文件中的sql语句,乱码. 先是执行show variables like '%char%'; +---------------------

MySQL数据库知识点整理 (持续更新中)

一.修改用户密码 格式(在命令行下输入):mysqladmin -u 用户名 -p旧密码 password 新密码 1. 给root添加密码ab12:  mysqladmin -uroot -password ab12 2. 将root的密码修改为djg345:    mysqladmin -uroot -pab12 password djg345 二.添加新用户 格式:grant 权限 on 数据库名.表名 to 用户名@登录主机  identified by "密码" 1. 增加一

Mysql注入小tips --持续更新中

学习Web安全好几年了,接触最多的是Sql注入,一直最不熟悉的也是Sql注入.OWASP中,Sql注入危害绝对是Top1.花了一点时间研究了下Mysql类型的注入. 文章中的tips将会持续更新,先说说这些天研究的 这里博主以数字类型注入类型进行讲解,字符类型同理,这里不在敖述. 我们的环境:phpstudy+mysql+php 我们的测试代码如下: <meta http-equiv="Content-Type" content="text/html; charset=

使用KVM虚拟机遇到的问题(持续更新)

1.qemu-kvm.kvm.qemu 和 qemu-system-x86_64四种命令的区别 qemu 和 qemu-system-x86_64:启动qemu虚拟机的命令,x86_64为64位系统时使用的命令 qemu-x86_64  仅仅模拟CPU qemu-system-x86_64 模拟整个PC qemu-kv和 kvm:如果要开启kvm支持,需要使用qemu-kvm或者kvm命令,暂时记为两个命令是等效的 2.用libvirt库创建虚拟机时会报错:internal error unab

RedHat 和 Mirantis OpenStack 产品的版本和功能汇总和对比(持续更新)

Mirantis 和 Red Hat 作为 OpenStack 商业化产品领域的两大领军企业,在行业内有重要的地位.因此,研究其产品版本发布周期和所支持的功能,对制定 OpenStack 产品的版本和功能规划有重要的参考意义. 1. 版本基本情况 OpenStack 版本 OpenStack GA 日期 RedHat OpenStack Platform 版本 Mirantis  OpenStack Juno 2014-10-16 6 (Feb 9, 2015) 6.0 (12/25/2014)

个人网盘2T资料整理分享(持续更新中)

一.       学习书籍下载 1.      数据库与数据结构数据  链接:  http://pan.baidu.com/s/1c094nSG  密码:13el 2.      汇编语言书籍          链接:  http://pan.baidu.com/s/1o63Kke2 密码:8udr 3.      Office书籍             链接:   http://pan.baidu.com/s/1hqgVNVI密码:m54m 4.      PHP书籍            

我的读书清单(持续更新)

我的读书清单(持续更新) 2017-05-31 <一千零一夜>2006(四五年级) <中华上下五千年>2008(初一) <鲁滨孙漂流记>2008(初二) <钢铁是怎样炼成的>2009(初二) <坏蛋是怎样炼成的>2010(初三) <平凡的世界>2011(高二) <悲惨世界>2012(高二) <穆斯林的葬礼>2012(高二) <红楼梦>2012(高二) <边城> <傲慢与偏见>