• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in the installation of MySQL.

 
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, after install MySQL 8.0.26 in Linux Centos 8 I trying to alter mysqld.cnf but I can't find this file. Where I find this file?
Thanks and best regards.
 
Saloon Keeper
Posts: 27884
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It doesn't exist. That's for an older version of MySQL. Also, note that if you're using the RPM/DNF installer, the actual "mysql" that comes with the OS is MariaDB. There are some places where the different name matters.

Your config information should be in /etc/my.cnf.d, but I can be more definite if I know what you want to change.
 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Learning in some web videos how to access remotely I saw that in mysql.cnf are there a parameter called bind-address that you set with IP address to do this access now what I want is how I do this.
 
Tim Holloway
Saloon Keeper
Posts: 27884
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
File is /etc/my.cnf.d/mariadb-server.cnf

You should see bind-address in the [mysqld] section. If not, add it:

 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is the content of my.cnf.d:

don't have mariadb information.
this grep show me that exist mysql directory in the /etc but I can't access:

tring to access I reveiving:
 
Tim Holloway
Saloon Keeper
Posts: 27884
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You tried to execute a directory name like it was a program.
 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tell me how grant access from my mysql workbench of my windows to mysql on my VPS all that I saw until now is to change bind-address from 127.0.0.1 to IP Address of my VPS.
 
Tim Holloway
Saloon Keeper
Posts: 27884
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Generally, you set bindaddress to 127.0.0.1 for access only on the local machine or 0.0.0.0 for access from any machine. If you use 0.0.0.0, then make sure you have set up your mysql machine's firewall appropriately.
 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok Tim but where I change it to 0.0.0.0 which in my case will be my IP address.
 
Tim Holloway
Saloon Keeper
Posts: 27884
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No. "0.0.0.0" means Listen TO all IP addresses. Not listen ON my IP address. Code it as "0.0.0.0" no matter what IP addresses your machine has.
 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Right, how I code 0.0.0.0 and where I code it, all my info points to mysqld.cnf but that file doesn't exist.
 
Tim Holloway
Saloon Keeper
Posts: 27884
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
/etc/my.cnf.d/mysql-server.cnf
 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I included bind-address as you said me but still no connection from mysql workbench with mysql server.
As you say /etc/my.cnf.d/mysql-server.cnf:
 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried too:
 
Marshal
Posts: 4541
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cezar Apulchro wrote:I included bind-address as you said me but still no connection from mysql workbench with mysql server.


Are you certain that it was a connection-related issue and not an authentication/authorization-related issue?

Have you checked firewalls on the host where database server is running, or where the client it trying to attach from, or in any interconnecting networks?

Have you tried disabling any antivirus applications (if any) on either side?
 
Ron McLeod
Marshal
Posts: 4541
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check that there is a listener on the host platform for 0.0.0.0 using  netstat -nat | grep 3306 (Linux) or netstat -nat | findstr 3306 (Windows).

For example:
 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Result:
 
Ron McLeod
Marshal
Posts: 4541
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So it looks like the database server is listening on all interfaces ✓.  The next step is to check that if there is a firewall running (iptables, firewalld, etc.), that it is allowing connections to TCP port 3306 from external endpoints.
 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I made the changes but I still with mysql workbench that don't access my mysql in vps.
 
Tim Holloway
Saloon Keeper
Posts: 27884
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you need this:

Because it looks like you're blocking access to port 3306 (mysql).

Incidentally, Ron, "netstat" is deprecated now. The replacement command is "ss". Fortunately the network processes have a lot of backwards compatibility. It took me forever to switch from "ifconfig" to "ip". I still mostly use "netstat".
 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Many URLs show "/etc/mysql/my.cnf" but in my mysql installation I don't have mysql folder in /etc, why haven't this folder in Centos 8?
URLs:

I must to create this folder and my.cnf manually?
 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I included bind-address in my.cnf but workbench still don't access my mysql.
 
Tim Holloway
Saloon Keeper
Posts: 27884
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you put it in the proper context?

The mysql-server.cnf file is in Windows INI-style file format with named sections. The bind-address line should be under the [mysqld] section.

THAT IS, if your configuration matches what I'm expecting.

The only way to get it actually right is to read the instructions for the mysql server that you actually have installed. Specifically, whichever brand of mysql you installed: Oracle MySQL or MariaDB. AND the instructions should also be instructions for the exact version of MySQL or MariaDB that you installed, as the config information changes depending on both the version of MySQL or MariaDB and also on the OS distro version that you are using to host the server.

It is necessary to read the documentation. Otherwise, you will just wander around in circles again, and waste a lot of time.
 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How you said me I believe that the bind-address seted now is right but Workbench still not access to MySQL.

 
Tim Holloway
Saloon Keeper
Posts: 27884
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The netstat looks OK, though I like the "-lnp" option, since it confirms that the holder of port 3306 is indeed a MySQL/MariaDB server.

However, assuming that's what's listening there, then you probably haven't opened your firewall to allow outside access. Look back at this thread and you'll see where I posted the firewall-cmd statements that you have to issue in order to open access to MySQL. You have to do this with root/sudo privileges.
 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
after thefirewall:

Still the the same.
 
Ron McLeod
Marshal
Posts: 4541
572
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

On the 14th of August Ron McLeod wrote:Are you certain that it was a connection-related issue and not an authentication/authorization-related issue?


On the 14th of August Ron McLeod wrote:Have you checked firewalls on the host where database server is running, or where the client it trying to attach from, or in any interconnecting networks?


On the 14th of August Ron McLeod wrote:Have you tried disabling any antivirus applications (if any) on either side?

 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now problem is solved, I changed the bind-address from 0.0.0.0 to my IP address in mysql-server.cnf.
Thanks and best regards.
 
Cezar Apulchro
Ranch Hand
Posts: 675
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I forgot to say that I had to create a user with access "%".
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic