I am trying to use mariadb for the first time on my MacOS system but having some difficulty in connection.
I have installed mariadb and created the database as they are available in commad prompt:
Mortozas-iMac:~ mak$ sudo /usr/local/mariadb/server/bin/mariadb
Password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.0.38-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| inteaccerp |
| mysql |
| performance_schema |
| test |
+--------------------+
5 rows in set (0.00 sec)
Then created user as follows:
CREATE USER 'mortoza' IDENTIFIED BY 'xxxx';
MariaDB [mysql]> grant USAGE ON *.* to 'mortoza'@'%' IDENTIFIED BY 'xxxx';
Query OK, 0 rows affected (0.00 sec)
MariaDB [mysql]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
Checked the GRANTS on the database as follows:
MariaDB [mysql]> show grants for 'mortoza'@localhost;
+----------------------------------------------------------------------------------------------------------------+
| Grants for mortoza@localhost |
+----------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'mortoza'@'localhost' IDENTIFIED BY PASSWORD '*71A423EE610B82E6695F355B08DD252520BF3E0A' |
| GRANT ALL PRIVILEGES ON `inteaccerp`.* TO 'mortoza'@'localhost' |
+----------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
Now Trying to connect from CUBA Studio that didn’t work.
When I test the connection I am getting the following error:
java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=localhost)(port=3306)(type=master) : Connection refused (Connection refused)
This connection failure could be originated from either the mariadb setup or connection setup problem in the studio, thanks for your help anyway.
Hi @mortozakhan
‘Test connection’ invokes java.sql.DriverManager.getConnection(String url, Properties info). The connection is shown ‘successful’ if no exceptions were thrown. It is a standard way, and the implemented in Studio logic does not modify it.
I have tried to reproduce your case on my database and got the same result: “Failed to connect”.
So it seems ‘USAGE’ ON *.* grants are not enough.
Try to test connection to your ‘inteaccerp’ database. As I see ‘mortoza’ has all grants to the database.
Then tried to connect using user mortoza, unfortunately the connection is failed. I also tried using root with empty password but still the same! Is problem lying here?
FYI, I followed this link to install MariaDb and wondering if there is any issue coming from the way it is installed. Do you suggest any methodology installing the MariaDb in MacOs?