在操作符命令下不能使用 运算表达式,可以使用 M,G等单位。
在mysql命令行中,可以使用 运算表达式, 不可以使用M,G等单位。
例: 在OS命令下:
[ mysql@localhost mysql]$ mysql --max-allowed-packet=16M -u root -p123456
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.6.23-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)
[ mysql@localhost mysql]$ mysql --max-allowed-packet=16*1024*1024 -u root -p123456
Unknown suffix '*' used for variable 'max_allowed_packet' (value '16*1024*1024')
Warning: option 'max_allowed_packet': unsigned value 0 adjusted to 4096
mysql: Error while setting value '16*1024*1024' to 'max_allowed_packet'
在mysql命令行下
mysql> set global max_allowed_packet=16M;
ERROR 1232 (42000): Incorrect argument type to variable 'max_allowed_packet'
mysql> set global max_allowed_packet=16*1024*1024;
Query OK, 0 rows affected (0.00 sec)
在mysql命令行中,可以使用 运算表达式, 不可以使用M,G等单位。
例: 在OS命令下:
[ mysql@localhost mysql]$ mysql --max-allowed-packet=16M -u root -p123456
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.6.23-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)
[ mysql@localhost mysql]$ mysql --max-allowed-packet=16*1024*1024 -u root -p123456
Unknown suffix '*' used for variable 'max_allowed_packet' (value '16*1024*1024')
Warning: option 'max_allowed_packet': unsigned value 0 adjusted to 4096
mysql: Error while setting value '16*1024*1024' to 'max_allowed_packet'
在mysql命令行下
mysql> set global max_allowed_packet=16M;
ERROR 1232 (42000): Incorrect argument type to variable 'max_allowed_packet'
mysql> set global max_allowed_packet=16*1024*1024;
Query OK, 0 rows affected (0.00 sec)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25099483/viewspace-1473179/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25099483/viewspace-1473179/