1. 程式人生 > >CentOS7 下調教mysql記實 之二

CentOS7 下調教mysql記實 之二

rac hang general username sta roo warnings 普通用戶 pan

導入SQL後,普通用戶不能調用存儲過程,root可以。

解決:

mysql> update mysql.proc set Definer=‘username@%‘;

然後修改Security_type字段:

MariaDB [(none)]> update mysql.proc set Security_type=‘INVOKER‘;

Query OK, 19 rows affected (0.00 sec)
Rows matched: 19 Changed: 19 Warnings: 0

MariaDB [(none)]> show function status;
+---------+-------------+----------+----------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation |
+---------+-------------+----------+----------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| redfish | GetDanHao | FUNCTION | bashen@% | 2017-05-20 11:24:57 | 2017-05-20 13:26:45 | INVOKER | | utf8 | utf8_general_ci | gbk_chinese_ci |

CentOS7 下調教mysql記實 之二