Mysql users have privilege "locations" [sorry i haven't really read the docs so I am not sure what term they use for it]. Let me explain.
When you grant privs to a user in MySQL you do something like this:
GRANT ALL PRIVILEGES ON database.* TO 'user'@'localhost';
This tells the MySQL server to grant permissions to database
to the user
, but ONLY if they are from localhost
. So if your MySQL server isn't on the same host as the Webserver localhost
would need to be the FQDN or IP address of where the user is 'from' or rather the where the request is originating from.
Example:
web server (ip address 192.168.0.5)
mysql server (ip address 192.168.0.10)
You would grant privs something like this:
`GRANT ALL PRIVILEGES ON database.* TO 'user'@'192.168.0.5';
As a side note to be more thorough although it sounds like it doesn't impact your case study: it is far better to not blanket authorize every MySQL directive to a user and to use a least permissions required model. So something like this would probably be more appropriate:
GRANT ALTER, CREATE, CREATE TEMPORARY TABLES, DELETE, DROP, EXECUTE, INDEX, SELECT, INSERT, LOCK TABLES, UPDATE ON database.* TO 'user'@'IP ADDRESS OF WEB SERVER';
wi17b082 I am hosting both the DB and osTicket on the same remote Desktop, so connecting as localhost should be fine right? Or do I have to specify a certain IP to connect from?
in this instance localhost should be fine. So long as you granted privs to root@localhost.