Mariadb refuses host connection

Issues related to applications and software problems
Post Reply
nhughes
Posts: 6
Joined: 2017/05/16 18:11:50

Mariadb refuses host connection

Post by nhughes » 2017/05/19 20:57:03

Hello all,

I am trying to configure a mariadb. I am new to CentOS and linux, so I apologize for silly mistakes or errors.

What do I need to do to allow my root to gain access to the maria db?

Below you can see an example of the error I'm receiving.
dbcheck.PNG
dbcheck.PNG (78.5 KiB) Viewed 1459 times
Do I need to configure maridb? if so, could someone point me in the right direction? also, will this configurations create problems with trying to configure LDAP authentication?

thank you very much.

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: Mariadb refuses host connection

Post by lightman47 » 2017/05/19 22:37:04

Likely little help, but "root" has NO PASSWORD as installed - to allow you in for initial setup. Thereafter you need to change that very unsafe situation.

As I understand thereafter, you add users, assign permissions for those users (and the interfaces from which they are to be allowed to connect), then disable/delete the 'root user', after you have allowed your 'admin user(s)' full permissions. Works for me with my minimal (inside) system.

Probably there are easier explanations.

Also, you posted a graphical interface snapshot I'd not seen ...

bertalanimre
Posts: 140
Joined: 2015/06/02 13:04:03

Re: Mariadb refuses host connection

Post by bertalanimre » 2017/05/22 07:14:52

Reading your problem, the following questions occurred in me:
- can you connect to your database in terminal with "mysql -u root" ?
- how did you install mariadb and what version do you have? (link or description please)
- why didn't you install mysql straight away? (it is also free and just "yum install mysql-community-server" after adding the repo)
- is mariadb running? (systemctl status mariadb)
- are you trieing to connect to a local database or a remote one?

I'll gladly help if you answer my questions, but all of them. I'll need these information. ;)

pjsr2
Posts: 614
Joined: 2014/03/27 20:11:07

Re: Mariadb refuses host connection

Post by pjsr2 » 2017/05/22 18:07:05

For a quick introduction in how to set up the mariadb database server, see for example https://www.server-world.info/en/note?o ... &p=mariadb.

Database users and their passwords are completely independent of the users defined in your computer.
The most confusing thing is that the default user with full privileges in the database is called 'root', same as the most powerful user of your computer. Nevertheless, they are completely unrelated and usually don't have the same password.

Database users are specified inside the mariadb database. For each user you can define from which host that user can connect. You may even give different passwords for connections from different host to the user with the same name.

The most powerful user is by default named 'root', but you could create other users with full privileges as well. For safety reasons, you should allow root only to login from the local computer.

Questions:
- Did you start the mariadb server with systemctl?
- Did you run the mysql_secure_installation scripts?
- Did you create a user in the database that should be used by the program that needs the database? (I don't recognize the program that you show in the picture).
- If your program is running on another computer, did you open the port for the database server in the firewall?

Post Reply