Linux MySQL 4G内存my.cnf配置表
# The following options will be passed to all MySQL clients[client]character-set-server = utf8 #####客户端默认连接字集集
# The following options will be passed to all MySQL clients
[client]
character-set-server = utf8 #####客户端默认连接字集集,若编译安装时已指定则不用填写
port = 3306 ###客户端连接通信端口
socket = /tmp/mysql.sock #客户端通信的用户密码端口等信息保存文件
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306 #mysql服务端监听端口
basedir = /usr/local/mysql ###Mysql软件目录
datadir = /usr/local/mysql/var ###mysql数据库存放目录
socket = /tmp/mysql.sock ##服务端通信文件,若丢失则重启Mysql重新生成,若重启失败,则可能由于mysqld进程未杀死,用pkill mysql后则能重启成功Mysql
pid-file =/usr/local/mysql/var/mysql.pid ##服务端pid进程文件,若丢失则重启Mysql重新生成,若重启失败,则可能由于mysqld进程未杀死,用pkill mysql后则能重启成功Mysql
skip-external-locking ###防止外部锁定表
skip-name-resolve ###禁止Mysqlr的DNS解析,只能通过IP连接数据库
key_buffer_size = 384M ###仅针对Myisam表引擎缓存优化
max_allowed_packet = 32M ###客户端最大查询表使用的内存
table_open_cache = 1024 ###服务器最大缓存表数量
sort_buffer_size = 2M ##每个连接的最大排序内存
join_buffer_size = 1M ##每个连接使用join查询语句的最大内存
net_buffer_length = 1M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
myisam_sort_buffer_size = 128M
thread_cache_size = 300
query_cache_size = 256M
query_cache_limit = 2M
thread_concurrency = 4 ##CPU*2
wait_timeout = 120 ###SQL语句最大执行时间
max_connections = 5000 ###允许数据库最大连接数
max_connect_errors = 6000 ##允许客户端连接数据库出错次数,能防止暴力破解数据库密码
character-set-server = utf8 ##服务器和数据库默认字符集
collation-server = utf8_general_ci ###客户端校正字符集
log_slow_queries = slowquery.log ##慢查询日志文件
long_query_time = 3 ###慢查询时间
myisam_recover ###mysql重启自动修复MYisam表
replicate-ignore-db = mysql ###数据同步时不需要同步的数据库名称
replicate-ignore-db = information_schema
bind-address = 121.14.145.96 ##服务器多个IP时写上比较重要
# 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
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin
# binary logging format - mixed recommended
binlog_format=mixed
# 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 = /usr/local/mysql/var
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /usr/local/mysql/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 = 32M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)

热门话题

InnoDB的全文搜索功能非常强大,能够显着提高数据库查询效率和处理大量文本数据的能力。 1)InnoDB通过倒排索引实现全文搜索,支持基本和高级搜索查询。 2)使用MATCH和AGAINST关键字进行搜索,支持布尔模式和短语搜索。 3)优化方法包括使用分词技术、定期重建索引和调整缓存大小,以提升性能和准确性。

本文讨论了使用MySQL的Alter Table语句修改表,包括添加/删除列,重命名表/列以及更改列数据类型。

文章讨论了为MySQL配置SSL/TLS加密,包括证书生成和验证。主要问题是使用自签名证书的安全含义。[角色计数:159]

文章讨论了流行的MySQL GUI工具,例如MySQL Workbench和PhpMyAdmin,比较了它们对初学者和高级用户的功能和适合性。[159个字符]

全表扫描在MySQL中可能比使用索引更快,具体情况包括:1)数据量较小时;2)查询返回大量数据时;3)索引列不具备高选择性时;4)复杂查询时。通过分析查询计划、优化索引、避免过度索引和定期维护表,可以在实际应用中做出最优选择。

聚集索引和非聚集索引的区别在于:1.聚集索引将数据行存储在索引结构中,适合按主键查询和范围查询。2.非聚集索引存储索引键值和数据行的指针,适用于非主键列查询。

是的,可以在 Windows 7 上安装 MySQL,虽然微软已停止支持 Windows 7,但 MySQL 仍兼容它。不过,安装过程中需要注意以下几点:下载适用于 Windows 的 MySQL 安装程序。选择合适的 MySQL 版本(社区版或企业版)。安装过程中选择适当的安装目录和字符集。设置 root 用户密码,并妥善保管。连接数据库进行测试。注意 Windows 7 上的兼容性问题和安全性问题,建议升级到受支持的操作系统。
