带参数的update mysql_mysql参数sql_update 说明

很多次通过本机的mysql命令发现,select 或者show

的时候,最多能显示1000行,并且每次

show variables like 'max_join%';

+---------------+---------+

| Variable_name | Value   |

+---------------+---------+

| max_join_size | 1000000 |

+---------------+---------+

1 row in set (0.00 sec)

而通过其他机器远程连接

确是这样的

show variables like 'max_join%';

+---------------+----------------------+

| Variable_name | Value

|

+---------------+----------------------+

| max_join_size | 18446744073709551615 |

+---------------+----------------------+

1 row in set (0.00 sec)

一直搞的我很疑惑,终于最近,找到原因了,一切都是mysql命令的一个参数(--safe_update)弄的,在--safe_update状态登录的话,在他连接的时候,会设置

SET sql_safe_updates=1, sql_select_limit=1000,

sql_max_join_size=1000000;

这样登录后,当然会出现select最多只能显示1000行了,

而在我的my.cnf配置中,很早之前别人给我设置了,所以才导致我曾经的疑惑

如:

[mysql]

safe-updates

其实我们登录后,通过status命令或者“\s”也能发现这个问题,当通过safe_update登录,我们查看得如下信息

mysql--root@localhostnone)

10:48:02>>\s

--------------------

--------------------

Note that you are running in safe_update_mode:

UPDATEs and DELETEs that don't use a key in the WHERE clause are

not allowed.

(One can force an UPDATE/DELETE by adding LIMIT # at the end of the

command.)

SELECT has an automatic 'LIMIT 1000' if LIMIT is not used.

Max number of examined row combination in a join is set to:

1000000

当然在mysql登录的时候,sql_select_limit

跟sql_max_join_size也是可以跟改的

如:mysql --safe-updates --select_limit=500

--max_join_size=10000

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值