0

I get this error installing gestioip. It connects to the DB as root, it creates a db (gestioip db) then it creates an user (the users: gestioip) but this user can't access the DB. (all this via browser on remote machine)

I've tried like similar posts state the following:

GRANT ALL PRIVILEGES ON dbname.* TO 'gestioip'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

FLUSH PRIVILEGES;

With no effect giving the error present on the topic. If I login the in console with:

mysql -u gestioip -p password

it works.

Needless to say that I've followed all the tutorials/installation manuals of the application.

The access to the DB is following:

gestioip@localhost
gestioip@127.0.0.1
gestioip@localhost.localdomain

Also first line in /etc/hosts:

127.0.0.1  localhost

EDIT: I installed a ubuntu with GUI and I'm doing the install from the LOCAL browser so no remote problems should arise.

miguels
  • 606
  • 1
  • 7
  • 30
  • What version of mysql are you using? Did you check the error logs for a clue – RiggsFolly Jan 14 '20 at 14:08
  • @RiggsFolly The title in the topic is the line in the "/var/log/mysql/error.log". More more logging info is shown. (apart from the app saying the user couldn't connect) – miguels Jan 14 '20 at 14:13
  • Does your `root` user account have a password set? – RiggsFolly Jan 14 '20 at 14:17
  • You still didn't mention the version of MySQL that you are using? – RiggsFolly Jan 14 '20 at 14:18
  • mysql version is 5.7.28 and I'm using ubuntu 18.04 LTS. The root account DOES have a password set. (I do login in mysql with it and remotely it creates the specified DB). I do use the command FLUSH PRIVILEGES every time I change privileges. – miguels Jan 14 '20 at 14:18
  • I am confused! When you do this `mysql -u gestioip -p password` you are logging on to a LOCAL MySQL But in your question you say **all this via browser on remote machine** – RiggsFolly Jan 14 '20 at 14:21
  • @RiggsFolly I login in my local machine with the gestioip user and it works. The application installation is done via browser (which is on another machine since this one is a server) and there's where the error is thrown. – miguels Jan 14 '20 at 14:26
  • Did you check that the `gestioip` actually has a `localhost` domain setup for it or did the install create a user account with some other domain? Just list all users when logged in as root – RiggsFolly Jan 14 '20 at 14:28
  • 2
    If gestioip is trying to log on from a machine other than the server, then localhost won't work. – Honeyboy Wilson Jan 14 '20 at 14:29
  • @HoneyboyWilson How can I configure it to work then? – miguels Jan 14 '20 at 14:38

2 Answers2

0

Try one of these to grant access to that user on the db u specified.

GRANT ALL PRIVILEGES ON dbname.* TO gestioip@localhost IDENTIFIED BY 'password'
GRANT ALL PRIVILEGES ON dbname.* TO 'gestioip'@'localhost' IDENTIFIED BY 'password'

U can look at this here Or check in MySQL references guide.

Dressy Fiddle
  • 163
  • 10
0

Instead of localhost use 127.0.0.1

In mysql they are not the same. I imagine your connecting on 127.0.0.1 but permissions are for localhost. That is why the command works. Don't mix and match them

exussum
  • 18,275
  • 8
  • 32
  • 65