I just installed Centos 7 and LAMP stack. However, I only can log in to Mariadb as root even though there is another user. I've been using MySQL for a couple of decades but I can't figure this out.

Basically everything seems to be all right and exactly the same user configuraiton worket fine with MySQL and previous centos 6.10. This another user (ie. John) can't log in to mariadb from cli neither can he login from phpmyadmin locally or remotelly. Only the root user can access databases.

I've tried third user, with the same result. All three have the following hosts with same privileges: %, localhost, ::1 and "host.domain.fi". And yes, I have committed the "flush privileges" sql-command.

I've even tried super complex passwords with no help. Only response is "ERROR 1045 (28000): Access denied for user 'test'@'localhost' (using password: YES)".

Only difference in the creation of users is that root user was created with mysql_secure_installation and others with phpmyadmin.

Anyone, ideas? This obviously is quite a hazard for secure use of my mariadb.


1 Answer 1


I do not see in your question any reference to the GRANT command you used to create the user. Did you used it? If not, try entering with root and then execute the following

GRANT ALL ON your_db_name.* TO 'test'@'localhost';
  • SHOW GRANTS FOR TEST; gives the following result: GRANT ALL PRIVILEGES ON . TO 'test'@'%' IDENTIFIED BY PASSWORD '*somehing'. When these users 'john' and 'test' were created, they were copies of the root account in phpmyadmin. So, all the privileges were inherited directly to these new users. Apr 1, 2019 at 3:44
  • Sorry about asterisks not shown. The result is: GRANT ALL PRIVILEGES ON [asterisk].[asterisk] TO 'test'@'%' IDENTIFIED BY PASSWORD '*somehing'. Apr 1, 2019 at 4:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .