# Error 0 (cannot connect to database)

**URL:** https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023
**Category:** Product Support
**Created:** [December 20, 2015, 10:16am UTC](https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023 "2015-12-20T10:16:01Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![xofnot](https://avatars.discourse-cdn.com/v4/letter/x/35a633/32.png) [@xofnot](https://forum.mautic.org/u/xofnot)
#### Post date: [December 20, 2015, 10:16am UTC](https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023/1 "2015-12-20T10:16:01Z")

</div>

Hi,  
  
  
  
I did not change anythibg (only thing happening are the default cron jobs every 12 hours) and now i can not access mautic anymore. I get a connection error #0.  
  
  
  
Anyine know what this means and how to solve it?

---

<div class="post-metadata">

### Author: ![xofnot](https://avatars.discourse-cdn.com/v4/letter/x/35a633/32.png) [@xofnot](https://forum.mautic.org/u/xofnot)
#### Post date: [December 20, 2015, 10:16am UTC](https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023/2 "2015-12-20T10:16:01Z")

</div>

Hi,

I did not change anythibg (only thing happening are the default cron jobs every 12 hours) and now i can not access mautic anymore. I get a connection error #0.

Anyine know what this means and how to solve it?

---

<div class="post-metadata">

### Author: ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)
#### Post date: [December 21, 2015, 8:28am UTC](https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023/3 "2015-12-21T08:28:09Z")

</div>

Maybe your MySql server is down. Contact your server provider and ask him for help. It doesn’t seem like a Mautic issue.

---

<div class="post-metadata">

### Author: ![retlaw68](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@retlaw68](https://forum.mautic.org/u/retlaw68)
#### Post date: [December 21, 2015, 8:03pm UTC](https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023/4 "2015-12-21T20:03:42Z")

</div>

After about a week of Mautic working well, I’m receiving the same error “Database connection error (code #0)”. MySql server is working fine, I use Bluehost.

---

<div class="post-metadata">

### Author: ![dbhurley](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dbhurley/32/2_2.png) [@dbhurley](https://forum.mautic.org/u/dbhurley)
#### Post date: [December 23, 2015, 2:06pm UTC](https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023/5 "2015-12-23T14:06:51Z")

</div>

How can you tell MySQL server is working fine? Not doubting you but trying to determine what we can test to fix the problem.

---

<div class="post-metadata">

### Author: ![retlaw68](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@retlaw68](https://forum.mautic.org/u/retlaw68)
#### Post date: [December 23, 2015, 10:23pm UTC](https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023/6 "2015-12-23T22:23:11Z")

</div>

My Wordpress website that Mautic is attached to is working fine.

---

<div class="post-metadata">

### Author: ![retlaw68](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@retlaw68](https://forum.mautic.org/u/retlaw68)
#### Post date: [December 24, 2015, 9:16pm UTC](https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023/7 "2015-12-24T21:16:50Z")

</div>

My host, Bluehost, and I have been unable to find any issues with the database that was created for Mautic. As I mentioned, Mautic was working great for about a week. Bluehost indicated that the error page at [http://www.walterlis.com/mautic/](http://www.walterlis.com/mautic/) is not something they would have in use.

---

<div class="post-metadata">

### Author: ![escopecz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/escopecz/32/370_2.png) [@escopecz](https://forum.mautic.org/u/escopecz)
#### Post date: [December 28, 2015, 5:03pm UTC](https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023/8 "2015-12-28T17:03:57Z")

</div>

Ok, Mautic clearly cannot connect to the database. These are the steps I’d take:

1. Clear the cache (remove the app/cache folder). Did it help?
2. Check the logs. PHP error log and the Mautic log in the app/logs folder. Is there some error message?
3. Check the database login information in the app/config/local.php file. Clear the cache if you change some value in it.

---

<div class="post-metadata">

### Author: ![retlaw68](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@retlaw68](https://forum.mautic.org/u/retlaw68)
#### Post date: [December 28, 2015, 10:11pm UTC](https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023/9 "2015-12-28T22:11:18Z")

</div>

None of these three options worked, so I just reinstalled Mautic. It’s working now, so hopefully the previous issue won’t resurface.

---

<div class="post-metadata">

### Author: ![bryanmcg](https://avatars.discourse-cdn.com/v4/letter/b/ac91a4/32.png) [@bryanmcg](https://forum.mautic.org/u/bryanmcg)
#### Post date: [August 17, 2016, 10:42pm UTC](https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023/10 "2016-08-17T22:42:08Z")

</div>

I got this error when updating from Mautic 1.4 to 2.1, I had to update my build of PHP during the process.  
I enabled the PDO\_mysql extension, and it works!

---

<div class="post-metadata">

### Author: ![espresso](https://avatars.discourse-cdn.com/v4/letter/e/5daacb/32.png) [@espresso](https://forum.mautic.org/u/espresso)
#### Post date: [August 18, 2016, 1:30pm UTC](https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023/11 "2016-08-18T13:30:30Z")

</div>

[quote=14698:@bryanmcg]I got this error when updating from Mautic 1.4 to 2.1, I had to update my build of PHP during the process.  
I enabled the PDO\_mysql extension, and it works![/quote]

Hi There,  
can you pls specify what did you do to get it working.  
I got the same problem here.  
I actually deleted 1.4 completed and tried to install 2.1 from scratch. PHP 7.0.9  
The error is  
Database connection error (code #0)

Looking at phpinfo() it appears that  
pdo is enabled and so is pdo\_mysql  
mysqlnd 5.0.12-dev - 20150407

---

<div class="post-metadata">

### Author: ![rahulteja](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@rahulteja](https://forum.mautic.org/u/rahulteja)
#### Post date: [September 6, 2017, 10:35am UTC](https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023/12 "2017-09-06T10:35:46Z")

</div>

I got this error and Just restarted my server and it is working.

---

<div class="post-metadata">

### Author: ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)
#### Post date: [February 2, 2020, 10:54pm UTC](https://forum.mautic.org/t/error-0-cannot-connect-to-database/3023/13 "2020-02-02T22:54:35Z")

</div>


