LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 09-05-2021, 09:50 AM   #1
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Rep: Reputation: 15
Mysql/Mariadb connection issues


I am running Slackware current with a 5.10.26 kernel. I have mysql/mariadb set up and running, i have bind-address=127.0.0.1 in the mysqld section of /etc/my.cnf.d/server.cnf. I can connect perfectly if I use

Code:
mysql -u <username> -p
but if i use

Code:
mysql --host=localhost --protocol=tcp --port=3307 test
i get

Code:
ERROR 2002 (HY000): Can't connect to server on 'localhost' (111)
I have tried this with localhost,127.0.0.1,192.168.0.250 for ports 3306 & 3307 (read somewhere mariadb uses 3307 and not 3306)

I have opened the ports in iptables

Code:
sudo iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 3307 -j ACCEPT
i have verified it is running (wouldn't let me connect if i used mysql -u <username> -p if it wasn't. I really need this to work and at a loss on what else to try, any help you could shed on this would be greatly appreciated.
 
Old 09-05-2021, 12:11 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by KrazyKanuk View Post
but if i use
Code:
mysql --host=localhost --protocol=tcp --port=3307 test
i get
Code:
ERROR 2002 (HY000): Can't connect to server on 'localhost' (111)
The port is 3306. Use ss -lntp | grep 3306 to see if something listens.
Quote:
I have tried this with localhost,127.0.0.1,192.168.0.250 for ports 3306 & 3307 (read somewhere mariadb uses 3307 and not 3306)
What error message do you get with localhost and 3306, and with 192.168.0.250 and 3306?

Can you show all netfilter rules (e.g., output of iptables -S)?
 
Old 09-05-2021, 01:08 PM   #3
KrazyKanuk
Member
 
Registered: Sep 2007
Location: St. Catharines, Ontario
Distribution: Slackware 15/64 bit
Posts: 139

Original Poster
Rep: Reputation: 15
I found the problem my /etc/rc.d/rc.mysqld had this in it:

Code:
SKIP="--skip-networking"
I changed it to this:

Code:
#SKIP="--skip-networking"
restarted mysqld and now all is well, persistence pays off.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Any Known Issues With Installing PhpMyAdmin with mariadb or mysql? Steve R. Linux - Software 8 08-22-2019 06:54 PM
LXer: KDE Participating in Google Summer of Code 2019, MariaDB Releasing New Open-Source MariaDB Enterprise Server, CentOS Celebrates 15th B LXer Syndicated Linux News 0 02-28-2019 06:50 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 03:35 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration