Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572
Rep:
problems connecting to mysql database
Hello. I'm having problems connecting to the mysql database on my system. I first noticed this when I was trying to set up the program anymeal. I subsequently tried using MySQL Administrator (mysql-admin), but had no luck. It gives my the following feedback:
Code:
Could not connect to host 'localhost'.
MySQL Error Nr. 2002
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Click the 'Ping' button to see if there is a networking problem.
I press the ping button, and it seems to connect.
Code:
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.166 ms
64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.165 ms
64 bytes from localhost (127.0.0.1): icmp_seq=6 ttl=64 time=0.160 ms
64 bytes from localhost (127.0.0.1): icmp_seq=7 ttl=64 time=0.164 ms
64 bytes from localhost (127.0.0.1): icmp_seq=8 ttl=64 time=0.189 ms
64 bytes from localhost (127.0.0.1): icmp_seq=9 ttl=64 time=0.163 ms
64 bytes from localhost (127.0.0.1): icmp_seq=10 ttl=64 time=0.162 ms
64 bytes from localhost (127.0.0.1): icmp_seq=11 ttl=64 time=0.162 ms
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572
Original Poster
Rep:
I figured it out. Turns out I did not have the server installed. Why this wasn't a dependency of the AnyMeal program, I'm not sure, but anyway, I now got it working. Also, for the AnyMeal program, I needed to set it to "network" from localhost, rather than running from mysqld.sock, which I couldn't get going.
Why this wasn't a dependency of the AnyMeal program, I'm not sure, but anyway, I now got it working.
This is confusing to beginning administrators, we were all there at one time. The reason it is not a dependency is because the MySQL server is not required to be on the local machine. You may have one MySQL server with many workstations attached to it, or you may have one workstation that attaches to many different MySQL servers.
Also, for the AnyMeal program, I needed to set it to "network" from localhost, rather than running from mysqld.sock, which I couldn't get going.
When both the MySQL server and the client (AnyMeal in your case) are on the same machine it is much better to work through sockets. Especially if your data is security sensitive. It's faster and you can prevent intrusions by completely disabling networking for MySQL. The fact that you have problems setting this to work via sockets is an indicator that there is something fundamentally wrong in the settings somewhere and I would investigate that further if this is a production setup.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.