以上就是给各位分享linux–MySQL:max_allowed_packet可能大于1GB吗?,同时本文还将给你拓展Can''tconnecttolocalMySQLserverthroughsoc
以上就是给各位分享linux – MySQL:max_allowed_packet可能大于1 GB吗?,同时本文还将给你拓展Can''t connect to local MySQL server through socket ''/opt/lampp/var/mysql/mysql.sock'' (2)、Can''t connect to local MySQL server through socket ''/var/lib/mysql/mysql.sock''、CentOS yum安装mysql后 Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’、centos7 设置 mysql 自启动的配置文件中 [Service] User=mysql Group=mysql,user 和 group 这边的 mysql 是指的什么?centos 的登录用户名?等相关知识,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:- linux – MySQL:max_allowed_packet可能大于1 GB吗?
- Can''t connect to local MySQL server through socket ''/opt/lampp/var/mysql/mysql.sock'' (2)
- Can''t connect to local MySQL server through socket ''/var/lib/mysql/mysql.sock''
- CentOS yum安装mysql后 Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’
- centos7 设置 mysql 自启动的配置文件中 [Service] User=mysql Group=mysql,user 和 group 这边的 mysql 是指的什么?centos 的登录用户名?
linux – MySQL:max_allowed_packet可能大于1 GB吗?
使用内部python脚本,我们从档案中提取文本,一些文件大到4 GB,其中的文本可以轻松达到1GB.然后我们使用Sphinxsearch使其可搜索.
所以现在我在将这些文本插入数据库时面临数据包太大的错误.
机器是64核心,64 GB的RAM,可以轻松handel Terrabytes.
所以我该怎么做?
另一个问题是,增加max_allow_packet是否也增加了内存使用量,在< 1GB包? 操作系统:Linux 2.6.39
MysqL:5.1和5.5
解决方法
根据page 99 of “Understanding MySQL Internals” (ISBN 0-596-00957-7),以下是第1-3段解释它:
MysqL network communication code was
written under the assumption that
queries are always reasonably short,
and therefore can be sent to and
processed by the server in one chunk,
which is called a packet in MysqL
terminology. The server allocates the
memory for a temporary buffer to store
the packet,and it requests enough to
fit it entirely. This architecture
requires a precaution to avoid having
the server run out of memory—a cap
on the size of the packet,which this
option accomplishes.The code of interest in relation to
this option is found in
sql/net_serv.cc. Take a look at my_net_read(),then follow the call to my_real_read() and pay
particular attention to
net_realloc().This variable also limits the length
of a result of many string functons.
See sql/field.cc and
sql/intem_strfunc.cc for details.
根据本书的摘录和max_allowed_packet上的MysqL文档,对于max_allowed_packet而言,基本上没有什么可以超越1G.但是,还有一个方面需要探讨BLOB和文本数据调优.
关于InnoDB和BLOB,Another question in Server Fault做了以下断言:innodb_log_file_size和innodb_log_buffer_size组合必须大于你的最大blob对象的十倍,如果你有很多大的对象.如果你不这样做(并且你不应该[1,2]),那么真的没有必要用它来打扰.查看MysqL性能博客,获取有关如何计算的详细报告.
还有另一个需要考虑的方面:选项net_buffer_length(默认为16K)用作MysqL数据包的初始化大小.数据包可以动态扩展到max_allowed_packet.它不可避免地缩回到net_buffer_length指定的大小. net_buffer_length的最大值为1M.您可能希望将此值设置为1M.如果您正在驾驶1G,可能没多大帮助,但也不会有任何伤害.
如果你真的想要一个大于1G的MysqL数据包,我引用的那本书摘录告诉你使用什么源代码来定义MysqL数据包内部.您可以自由尝试提高限额.但是,如果代码假定1G除了设置显式数字之外,源代码可能具有自己的内部限制.
我希望这个信息有帮助!
Can''t connect to local MySQL server through socket ''/opt/lampp/var/mysql/mysql.sock'' (2)
ERROR 2002 (HY000): Can''t connect to local MySQL server through socket ''/opt/lampp/var/mysql/mysql.sock'' (2)
原因:系统盘满了
[root@localhost opt]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
18G 17G 0 100% /
tmpfs 504M 0 504M 0% /dev/shm
/dev/sda1 477M 80M 372M 18% /boot
[root@localhost opt]#
解决:
删除大文件后,重启系统解决
[root@localhost mysql]# /opt/lampp/lampp status
Version: XAMPP for Linux 1.8.3-3
Apache is not running.
MySQL is not running.
ProFTPD is running.
df: 未处理文件系统
[root@localhost opt]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
18G 17G 0 100% /
tmpfs 504M 0 504M 0% /dev/shm
/dev/sda1 477M 80M 372M 18% /boot
[root@localhost opt]#
[root@localhost ~]# /opt/lampp/lampp status
Version: XAMPP for Linux 1.8.3-3
Apache is not running.
MySQL is running.
ProFTPD is running.
转
xampp 无法启动mysql 找不到mysql.sock
(2016-02-24 23:21:24)
分类: 技术 |
如果xampp中的mysql启动不了,出现ERROR 2002 (HY000): Can''t connect to local MySQL server through socket ''/opt/lampp/var/mysql/mysql.sock'' (2)报错,
停止xampp的时候报:
-bash-4.1# /opt/lampp/lampp stop
Stopping XAMPP for Linux 1.8.2-6...
XAMPP: Stopping Apache...ok.
XAMPP: Stopping MySQL...ok.
XAMPP: Stopping ProFTPD...kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
fail.
解决办法:
如果网上一些方法不好用的话,可以试试以下方法:
1. 确定系统盘是否满了
#df -h
2. 删除/opt/lampp目录中的pid文件(删掉后xampp重启时会重建,如果不放心,可以先备份lampp目录)
删除mysql相关缓存:
#rm -rf /opt/lampp/var/mysql/VM_*
删除proftp相关缓存:
#rm -rf /opt/lampp/var/proftpd.pid
如果找不到pid文件,可以搜一下:
#find /opt/lampp -name ''*.pid''
Can''t connect to local MySQL server through socket ''/var/lib/mysql/mysql.sock''
MySQL已经被我移到数据盘了,本地连接数据库会报错:Can''t connect to local MySQL server through socket ''/var/lib/mysql/mysql.sock''
但是远程是可以连接的,my.cnf设置mysql的根目录也改成了数据盘的地址,还要在加上client的参数,设置如下:
[client]
socket = /home/data/mysql/mysql.sock
之后重启下mysql就可以了
CentOS yum安装mysql后 Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’
亲,是不是忘记了开MysqL服务,service MysqLd startcentos7 设置 mysql 自启动的配置文件中 [Service] User=mysql Group=mysql,user 和 group 这边的 mysql 是指的什么?centos 的登录用户名?
centos7 设置 mysql 自启动的配置文件中
[Unit] Description=MySQL Server Documentation=man:mysqld(8) Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html After=network.target After=syslog.target [Install] WantedBy=multi-user.target [Service] User=mysql Group=mysql ExecStart=/usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf LimitNOFILE = 5000 #Restart=on-failure #RestartPreventExitStatus=1 #PrivateTmp=false
这里的
[Service]
User=mysql
Group=mysql,
user 和 group 这边的 mysql 是指的什么?centos 的登录用户名?还是其他呢?
关于linux – MySQL:max_allowed_packet可能大于1 GB吗?的介绍现已完结,谢谢您的耐心阅读,如果想了解更多关于Can''t connect to local MySQL server through socket ''/opt/lampp/var/mysql/mysql.sock'' (2)、Can''t connect to local MySQL server through socket ''/var/lib/mysql/mysql.sock''、CentOS yum安装mysql后 Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’、centos7 设置 mysql 自启动的配置文件中 [Service] User=mysql Group=mysql,user 和 group 这边的 mysql 是指的什么?centos 的登录用户名?的相关知识,请在本站寻找。
本文标签: