Connecting through PHP to a MySQL user with less privileges

2015-03-14T22:48:58

Maybe I am missing something, I am misunderstanding something about MySQL-PHP connections... I can't figure. I know it will be a lot to read but I can't put this in less words... Sorry!

The problem is: I am using XAMPP; I created in Phpmyadmin a 'user' with less privileges than user "root" (only INSERT and UPDATE) and then I am connecting in php file with this new user to MySQL. After connecting and selecting a specific db ('test'), I am using a DELETE query just to see what it does, and it actually deletes the row from a table I specify even though I expected it won't be able to do this since the user I used to connect to the db has only insert and update privileges. What am I missing?

In phpmyadmin, in 'mysql' db - 'user' table, my low privileges 'user' appears and it has the exact privileges i granted it and they are global! Still, if I connect to another db with this 'user' and try to use delete query, it will say access denied. So it acts like an "admin" with only one DB ('test') but has limited privileges on all others.

Here's a screen shot from tab 'Users'. The limited user is at the bottom ('user') - http://gyazo.com/1ed0218982a4b80eb2927cee78e2a46c

Copyright License:
Author:「Irina」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/29050217/connecting-through-php-to-a-mysql-user-with-less-privileges

About “Connecting through PHP to a MySQL user with less privileges” questions

Maybe I am missing something, I am misunderstanding something about MySQL-PHP connections... I can't figure. I know it will be a lot to read but I can't put this in less words... Sorry! The probl...
I know there are a lot of threads asking this question already, but I have been at this for hours and am at wits end. I am attempting to connect to a MySQL database that I am running of my MacBook...
UPDATE: Contacted the web host for my website and they said Remote mysql connections are not enabled on the shared server, you would need a VPS for that. Trying to connect to an online database
I have this php function: function createDatabase($dbName,$dbPass) { $host = 'localhost'; $user = 'myuser'; $user_password = 'mypass'; $db = new PDO("mysql:ho
I have a question regarding how to grant privileges MySQL user accounts. I have a MySQL user account, and in my example code I would like to grant privileges to the whole database. When I run the c...
I'm making a login page well i've actually finished the login but how would i go about having the web page display diffren't things based on a users privileges and how would i set the privileges in...
I am trying to migrate SQL Server to Aurora My SQL. When I am trying to run Schema conversion tool, it gives below error when connecting to target (Aurora- MySQL). Insufficient Privileges - The spe...
I'm building a PHP app tied to a MySQL-based database called "cc". For looking up user (or user group) privileges on my database, is it necessary for the app to connect to the "mysql" database jus...
I am separating a PHP web server and moving my MySQL db to another box. Actually two instances on AWS. I can connect as the user to the new MySQL box but can not execute any queries. On MySQL:
I use PhpMyAdmin to setup mysql tables and such. I also have root (full) access to everything. Currently I have this in my phpMyAdmin under the privileges tab: USER: HOST: PASS:

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.