Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: ]SOLVED] MySQL workbench, fails to make a connection (Read 2149 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

]SOLVED] MySQL workbench, fails to make a connection

Hey guys, I hope all of you are safe and sound !

Im having trouble making a local connection.
I have installed mysql-openrc
mariaDB
and of course MySQL Workbench.

when I try to 'sudo rc-service mysql start'

i get this
Code: [Select]
Could not open required defaults file: /etc/mysql/my.cnf
Fatal error in defaults handling. Program aborted
 * Checking mysqld configuration for mysql ...
Could not open required defaults file: /etc/mysql/my.cnf
Fatal error in defaults handling. Program aborted
 * mysql config check failed                                                        [ !! ]
 * ERROR: mysql failed to start

and no /etc/mysql/my.cnf exists in my system. However, there is a /etc/my.cnf.d
I have look around the web but nothing has solve my problem. I hope you guys could help.

Re: MySQL workbench, fails to make a connection

Reply #1
Looks like you may want mariadb-openrc instead of mysql-openrc

Edit:
Was told you can set the config in /etc/conf.d/mysql and mysql-openrc should work fine for mariadb

Re: MySQL workbench, fails to make a connection

Reply #2
Thanks, I had it installed I just started it, and is working, however I can't  connect to the local connection on workbench.

when I try to test the connection i get

"Failed to connect to MySQL  at localhost:3306 with user root : access denied for user 'root'@'localhost" "

and

"your connection attempt failed for 'root' to the MySQL server at localhost:-3306: the name org.freedesktop.secrets was not provided by any .service files"

Re: MySQL workbench, fails to make a connection

Reply #3

Edit:
Was told you can set the config in /etc/conf.d/mysql and mysql-openrc should work fine for mariadb
 
thank you for that,

btw I discovered that I needed gnome-keyring, so the password error is now cleared,

however now I have this error message

"lost connection to MySQL server at 'reading initial communication packet', system error : 0,"

Re: MySQL workbench, fails to make a connection

Reply #4
I figured it out, in case anybody stumbles this issue:

I had to log in to MariaDB from the terminal and grant privileges to the user making the connection in MySQL workbench and then specifying the right port which is the default


 

Re: ]SOLVED] MySQL workbench, fails to make a connection

Reply #5
It usually  indicates network connectivity trouble and you should check the condition of your network if this error occurs frequently. It might be because the MySQL server is bound to the loop-back IP (127.0.0.1 / localhost) which effectively cuts you off from connecting from “outside”. If this is the case, you need to upload the script to the webserver (which is probably also running the MySQL server) and keep your server host as ‘localhost’ Another common cause of connect timeouts is the reverse-DNS lookup that is necessary when authenticating clients. It is recommended to run MySQL with the config variable in my.cnf:

  • Open mysql configuration file named my.cnf and try to find “bind-address”, here replace the setting (127.0.0.1 OR localhost) with your live server ip (the ip you are using in mysql_connect function).

  • Restart service by command : service httpd restart

  • GRANT ALL PRIVILEGES ON yourDB.* TO 'username'@'YOUR_APPLICATION_IP' IDENTIFIED BY 'YPUR_PASSWORD' WITH GRANT OPTION;