Ami Malimovka
Ami Malimovka

Reputation: 457

mysql queries run as root

My situation is like this: I have two servers, one is a windows server running IIS and holds my web site. The other is a linux server that holds my mysql server.

I created a (mysql) user on the mysql server with a minimum set of privileges, and I use its credentials when connecting from my website to run queries.

But when I run a query, and check the processes that are running on the mysql server (mysql> show processlist), I see that the query I executes (from the web site) is being run under the (mysql) root account!

Any idea why this should happen??


Hituptony got it :-) My query was processed by a SP, and turned into a prepared statement and then run... That SP was defined with the root account (god knows why), and more ever didn't have the "invoker" security clause.

http://dev.mysql.com/doc/refman/5.5/en/stored-programs-security.html

Upvotes: 2

Views: 2060

Answers (1)

Hituptony
Hituptony

Reputation: 2860

I guess it would depend on what you are doing, if you are running a stored procedure and it is created by a root account, then when you run it it will still show the "user who created" it as the one running it, when in reality it is probably the connection user. In theory if you are running a select statement you would therein be running as the connection user, as there would be no "creator" to the select...if you catch my driftage...

Upvotes: 1

Related Questions