Database Error Connection & Timing Out Issues?

Questions regarding the Database Server
MySQL, PostgreSQL, MariaDB, Percona Server, phpMyAdmin, phpPgAdmin
JRobinsonOnline
Posts: 8
Joined: Sun Feb 14, 2016 11:56 pm

Re: Database Error Connection & Timing Out Issues?

Postby JRobinsonOnline » Fri Oct 14, 2016 1:09 pm

Guys instead of looking into the dark hole - partly because I'm very limited on this type of stuff and everyone's time os important....
I created a new domain > and attempted to create a DB via my VestaCP. This was not possible I was getting "error connection" issues right from the VestaCP UI. I proceeded via SSH > sudo /etc/init.d/mysqld stop > sudo mysqld_safe --skip-grant-tables & > came back to VestaCP and was able to create the DB.

By the way this is the only way I can log into myPHPAdmin via the VestaCP UI as well....
Once I use the sudo /etc/init.d/mysqld stop > sudo /etc/init.d/mysqld start out of safe mode!!!!!!

The issue comes back. I've confirmed the DB/User/Passwords so I'm clueless as to what the heck is going on???

mehargags
Moderators
Posts: 786
Joined: Sat Sep 06, 2014 9:58 pm
Contact:

Re: Database Error Connection & Timing Out Issues?

Postby mehargags » Fri Oct 14, 2016 4:48 pm

Ok JRobinsonOnline,

Let me start over... and please try to be as descriptive as you can:

Your Server Specs: RAM / Cores / Storage Space and who is your provider (important)

1. How many sites and DBs you have in total ? Are these wordpress ?
2. You said "only one site has problem connecting DB", do the other sites use a DB or are they static ones ?

3. do you have Swap On ? paste result for

Code: Select all

swapon -s


4.

Code: Select all

dmesg | grep mysql


5. if it reports ariadb errors, Delete ariadb logs/control file from /var/lib/mysql

6. # optimise and Repair all DBs
mysqlcheck --all-databases -o
mysqlcheck --all-databases --auto-repair
mysqlcheck --all-databases --analyze

after all this

7. # Clean MySQL logs

Code: Select all

> /var/log/auth.log
> /var/log/mysql/error.log
> /var/log/mysql.log
> /var/log/mysql.err


Code: Select all

tail -f /var/log/mysql/error.log

Now access your problem site... and observe errors posted there in the tail.

---------------
Send your observations and we'll try to find the culprit

JRobinsonOnline
Posts: 8
Joined: Sun Feb 14, 2016 11:56 pm

Re: Database Error Connection & Timing Out Issues?

Postby JRobinsonOnline » Fri Oct 14, 2016 8:23 pm

mehargags wrote:Ok JRobinsonOnline,

Let me start over... and please try to be as descriptive as you can:

Your Server Specs: RAM / Cores / Storage Space and who is your provider (important)

1. How many sites and DBs you have in total ? Are these wordpress ?
2. You said "only one site has problem connecting DB", do the other sites use a DB or are they static ones ?

3. do you have Swap On ? paste result for

Code: Select all

swapon -s


4.

Code: Select all

dmesg | grep mysql


5. if it reports ariadb errors, Delete ariadb logs/control file from /var/lib/mysql

6. # optimise and Repair all DBs
mysqlcheck --all-databases -o
mysqlcheck --all-databases --auto-repair
mysqlcheck --all-databases --analyze

after all this

7. # Clean MySQL logs

Code: Select all

> /var/log/auth.log
> /var/log/mysql/error.log
> /var/log/mysql.log
> /var/log/mysql.err


Code: Select all

tail -f /var/log/mysql/error.log

Now access your problem site... and observe errors posted there in the tail.

---------------
Send your observations and we'll try to find the culprit


@mehargags here's what I did:


Ram: 3GB / Cores: 4 / Storage: 115GB / Provider: RamNode

1. 8 Sites (some with files others are just domains) - 3 of those are using Wordpress/Databases

2. (2) of out the 3 WP sites continue to operate “meaning I can visit them via URL” the (1) in question only is visible when I am in Mysql Safe Mode - tables granted

3. When I log in via SSH root and use command “swapon -s” I get the following…
Filename - Type - Size - Used - Priority
/dev/null partition 524288 76680 -1

Moving forward using command mysql I get an ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

As a result I stop/start mysql in safe mode using sudo /etc/init.d/mysqld stop and sudo mysqld_safe --skip-grant-tables &
Only then I am able to run the following…

4. Using command “dmesg | grep mysql” I get no response

5. No response, no errors

6. http://empme.org/mysqlcheck%20--all-databases%20--analyze.html
http://empme.org/mysqlcheck%20--all-databases%20--auto-repair.html
http://empme.org/mysqlcheck%20--all-databases%20-o.html


7. Unless I stay in mysql safemode I get:
-bash: /var/log/auth.log: Permission denied
-bash: /var/log/mysql/error.log: No such file or directory
-bash: /var/log/mysql.log: Permission denied
-bash: /var/log/mysql.err: Permission denied

8. tail: cannot open `/var/log/mysql/error.log' for reading: No such file or directory
tail: no files remaining

I am at a total lost man...Thanks for helping

blueberry
Posts: 22
Joined: Tue May 02, 2017 9:35 am

Re: Database Error Connection & Timing Out Issues?

Postby blueberry » Wed May 10, 2017 4:55 am

Hi, not sure if i can start a new thread, but decided to post here, cos it appears i might have a similar issue. I was trying to upload a 6mb mysql database via Phpmyadmin, it keeps loading forever. These files have been edited, apache, mysql all restarted and rebooted several times.

Server is Core 2 Duo, 4gb Memory, Setup on Local Network, Dynamic DNS/ Dynamic IP all setup properly. FTP upload was fast and working good.

Can anyone kindly advice what else can be done?

-------

sudo nano /usr/share/phpmyadmin/libraries/config.default.php
$cfg['ExecTimeLimit'] = 0;

edited php.ini and verified via phpinfo file, all settings updated. Phpmyadmin import filesize was also reflected correctly.

post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 300
max_input_time = 540
memory_limit = 1000M

sudo nano /etc/mysql/my.cnf

max_allowed_packet = 512M
wait_timeout=600

mehargags
Moderators
Posts: 786
Joined: Sat Sep 06, 2014 9:58 pm
Contact:

Re: Database Error Connection & Timing Out Issues?

Postby mehargags » Wed May 10, 2017 6:17 pm

blueberry
pls mention your OS and Version.
If ubuntu, most probably phpmyadmin bug. You can try updating the PHPMyAdmin to latest.

blueberry
Posts: 22
Joined: Tue May 02, 2017 9:35 am

Re: Database Error Connection & Timing Out Issues?

Postby blueberry » Thu May 11, 2017 12:38 am

hi, thank you for your reply. Sorry, OS is ubuntu 16.04 lts server edition, phpmyadmin version is 4.5. I will try updating phpmyadmin in a while.

blueberry
Posts: 22
Joined: Tue May 02, 2017 9:35 am

Re: Database Error Connection & Timing Out Issues?

Postby blueberry » Sat May 13, 2017 10:51 am

Thanks, so far i tried updating to the latest from the repo, Phpmyadmin 4.6.6, seems better and ok now.

mehargags
Moderators
Posts: 786
Joined: Sat Sep 06, 2014 9:58 pm
Contact:

Re: Database Error Connection & Timing Out Issues?

Postby mehargags » Sun May 14, 2017 6:00 am

Glad...
Pls mark your thread resolved

blueberry
Posts: 22
Joined: Tue May 02, 2017 9:35 am

Re: Database Error Connection & Timing Out Issues?

Postby blueberry » Sun May 14, 2017 9:50 am

Hi, im not sure how to mark as closed. I'm not the original thread poster.


Return to “Database Server”



Who is online

Users browsing this forum: No registered users and 1 guest