LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-14-2017, 08:02 PM   #1
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,342
Blog Entries: 28

Rep: Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145
Curiosity: SQL "Error Creating Database Connection" Error


I get the above error from time to time from my blog's database. It's annoying, but it's normally easily fixed by opening phpMyAdmin and running a "repair table" on all tables (I usually also do a "check" and an "optimize" just for good measure).

My question is more of a background question. Although I know a bit about MySQL and MariaDB and a lot about phpMyAdmin, I am by no means qualified to be an database admin.

Here's the question: what kinds of problems in the database may cause this error? Inquiring minds want to know.

Please note this is not an urgent cry for help. It's mild cry for knowledge.
 
Old 09-15-2017, 01:34 AM   #2
WildPossum
Member
 
Registered: Feb 2004
Location: Sydney - Australia
Distribution: Ubuntu, OpenSUSE, Mythbuntu, Embedded Linux
Posts: 46

Rep: Reputation: 18
Whilst I am not an expert to say the least.

Your error message reads to me like its the port connection that the DB is failing to use.

Usually on MySQL the port 3306 is used by default. I would check and see what port your Maria-DB & MySQL-DB uses in their configuration file(s). Also see what ports are uses by "netstat -a -p" preferably as root.

Maybe there is more than one service trying to use the assigned DB port, hence intermittent error(s) when a less active process tries to use the same port # or two services collide. Of course you would expect that all processes would open/use/close with port locking but maybe that is not happening for some unknown reason. However is it probably something much more simple (always is after you stumble on the fix IMHO).

My experience with systems that hang || halt at times usually because of older process mistakes leaving corrupted code hanging around unfortunately. So, dependent on the Linux Distro your currently using, run checks on the DB & php packages to ensure no code corruption or incomparability. I typically do "apt upgrade" as su.

Also after errors happening again go and investigate all associated logs eg:
sudo tail -n 100 /var/log/system | grep Database // See what happening to your DB process

"Hopefully the mental horizon traveled is a little further out of the darkness."
Cheers G.

Last edited by WildPossum; 09-15-2017 at 01:39 AM.
 
Old 09-18-2017, 08:15 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,342

Original Poster
Blog Entries: 28

Rep: Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145
Quote:
Your error message reads to me like its the port connection that the DB is failing to use.
That makes sense. Note that this on a VPS provided by my hosting provider.

I guess I'm asking what may be making it fail. Since doing routine database management tasks makes the error go away, I'm guessing that it's something errant in the tables, but my guess could be way off base.

Thanks for your response.
 
Old 09-21-2017, 07:56 AM   #4
WildPossum
Member
 
Registered: Feb 2004
Location: Sydney - Australia
Distribution: Ubuntu, OpenSUSE, Mythbuntu, Embedded Linux
Posts: 46

Rep: Reputation: 18
Have you asked your Providers Support Team.

Hi again.

I would suggest -- if you haven't already done so -- is to ask your VPS providers' support people have they seen this problem before (they may have incorrectly configured your service so have them check this out!). Are they aware of any issues on their side where delayed DB management [scripts] maybe tardy in correcting issues i.e.: causing what your seeing.
And what if anything that your kicking off DB admin seems to correcting back on their severside.

Apart from this unfortunately I am not able to assist you much more.

Cheers, G.
 
  


Reply

Tags
database connection, sql



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
Fixing "Error Establishing Database Connection" Question frankbell Linux - General 3 04-30-2017 09:30 PM
Samba errors:"Transport endpoint is not connected","Error Connection" fcintron Linux - Server 0 11-13-2014 07:44 PM
[SOLVED] NFS mount Error: "System Error: Connection refused" SenLinux Linux - Networking 4 10-17-2010 11:30 AM
Need solution to "failed to fork PTY" and "error creating the child process" problems Gnusboy Linux - Newbie 4 01-02-2010 07:54 AM
anybody familiar with this error "Xlib: connection to ":0.0" refused by server" ? rajnivanza Linux - Newbie 3 03-22-2009 05:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:46 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