Answers.Body: <p>In all of your database changes, you may have mixed up the database information in one or the other of your <code>civicrm.settings.php</code> files.  In Joomla there are two:</p>
  
  <pre><code>administrator/components/com_civicrm/civicrm.settings.php
  </code></pre>
  
  <p>and</p>
  
  <pre><code>components/com_civicrm/civicrm.settings.php
  </code></pre>
  
  <p>They should be <em>almost</em> identical: the site URL for the one in <code>administrator</code> should be <code>http://yoursite.org/administrator/</code> rather than just the base URL of your site.</p>
  
  <p>Both have database connection information; so does your Joomla <code>configuration.php</code> file.  You need all three to agree on the Joomla database information (the line with <code>CIVICRM_UF_DSN</code> in the CiviCRM files), and you need the two CiviCRM files to agree on the CiviCRM database information (the line with <code>CIVICRM_DSN</code>).</p>
  
  <p>If you think you've hopelessly ruined your CiviCRM settings files, you can rebuild them from the copy at</p>
  
  <pre><code>administrator/components/com_civicrm/civicrm/templates/CRM/common/civicrm.settings.php.template
  </code></pre>
  
  <p>You will want to keep your existing ones handy as a guide (and a fallback in case you cause trouble), and you'll need to replace all the tokens, which appear as <code>%%tokenname%%</code> in the file.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-13T01:54:48.990Z
Answers.Text: I deleted all the civicrm_ tables in my Joomla database. I completely uninstalled the civi components. I then reinstalled Civi from scratch. How would there be errors in a setup file that affects how CiviMail functions in a clean install? Am I missing something?
Answers.UserDisplayName: S Christopher
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-14T00:36:25.360Z
Answers.Text: You're right--that seems unlikely in your context.  Be aware that CiviCRM will automatically use your Joomla database when it tries to install. There may be some problem in the database itself.  You should also enable debugging: that will tell you the DB query that's failing and a bit more help.
Answers.UserDisplayName: Andie Hunt
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-09T16:58:47.280Z
Answers.LastActivityDate: 2016-05-09T16:58:47.280Z
Answers.UserDisplayName: Andie Hunt
Body: <p><a href="https://i.sstatic.net/idVXy.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/idVXy.png" alt="enter image description here" /></a>Civi 4.6.15
  Joomla 3.5.1</p>
  <p>Previously I upgraded my civi version to 4.7, and somehow I corrupted my database. I reinstalled a clean 4.6.15 and restored my database from backup.</p>
  <p>It seemed to be working. I was able to send a New Mailing by executing &quot;Send Scheduled Mailings&quot; with no issues. 10 minutes later, I attempted to send another email to the same group and the same manual execution, but I'm getting:</p>
  <blockquote>
  <p>Sorry but we are not able to provide this at the moment. <br>
  DB Error: no database selected<br></p>
  <p>Return to home page.</p>
  </blockquote>
  <p>I can still access contacts, and I can still see the groups.</p>
  <p>Any ideas on where to start?</p>
  <p>-EDIT 5/8/16-</p>
  <p>I ended up exporting contact info, uninstalling Civi, deleting the media folder, deleting all associated database info in my Joomla database, reinstalling Civi (4.7.7), and importing contacts back into the system. Yes, it's an insane Neanderthal way to do it, but I ran out of options.</p>
  <p>I just attempted to send an email to about 55 recipients using the CiviMail component (see below). I manually initiated it via the Send Scheduled Mailings in the Scheduled Jobs area.</p>
  <p>It hangs then displays the DB error message above.</p>
  <p>For some recipients, they receive the email multiple times. Others never see it. The report says there are zero successful deliveries, but it also shows tracked opens:</p>
  <p><a href="https://i.sstatic.net/HcLBn.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/HcLBn.png" alt="enter image description here" /></a></p>
  <p>If I try to send another email, it reinitiates the send on emails that have not been cancelled.</p>
  <p>I thought I completed a last resort option of rebuilding everything. Since that didn't work, I don't know what to do. I'm desperate for any suggestions.</p>
  
Tags: <civimail><joomla><database><4.7><scheduled-job>
Title: CiviMail DB Error: no database selected
ThreadText: # CiviMail DB Error: no database selected
  
  (Asked by: username_0 on 2016-04-27)
  
  [![enter image description here](https://i.sstatic.net/idVXy.png)](https://i.sstatic.net/idVXy.png)Civi 4.6.15
  Joomla 3.5.1
  
  Previously I upgraded my civi version to 4.7, and somehow I corrupted my database. I reinstalled a clean 4.6.15 and restored my database from backup.
  
  It seemed to be working. I was able to send a New Mailing by executing "Send Scheduled Mailings" with no issues. 10 minutes later, I attempted to send another email to the same group and the same manual execution, but I'm getting:
  
  > Sorry but we are not able to provide this at the moment.   
  > DB Error: no database selected
  >
  > Return to home page.
  
  I can still access contacts, and I can still see the groups.
  
  Any ideas on where to start?
  
  -EDIT 5/8/16-
  
  I ended up exporting contact info, uninstalling Civi, deleting the media folder, deleting all associated database info in my Joomla database, reinstalling Civi (4.7.7), and importing contacts back into the system. Yes, it's an insane Neanderthal way to do it, but I ran out of options.
  
  I just attempted to send an email to about 55 recipients using the CiviMail component (see below). I manually initiated it via the Send Scheduled Mailings in the Scheduled Jobs area.
  
  It hangs then displays the DB error message above.
  
  For some recipients, they receive the email multiple times. Others never see it. The report says there are zero successful deliveries, but it also shows tracked opens:
  
  [![enter image description here](https://i.sstatic.net/HcLBn.png)](https://i.sstatic.net/HcLBn.png)
  
  If I try to send another email, it reinitiates the send on emails that have not been cancelled.
  
  I thought I completed a last resort option of rebuilding everything. Since that didn't work, I don't know what to do. I'm desperate for any suggestions.
  
  **Tags:** civimail, joomla, database, 4.7, scheduled-job
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-05-09. Score: 1
  
  In all of your database changes, you may have mixed up the database information in one or the other of your civicrm.settings.php files.  In Joomla there are two:
  administrator/components/com_civicrm/civicrm.settings.php
  
  and
  components/com_civicrm/civicrm.settings.php
  
  They should be almost identical: the site URL for the one in administrator should be http://yoursite.org/administrator/ rather than just the base URL of your site.
  Both have database connection information; so does your Joomla configuration.php file.  You need all three to agree on the Joomla database information (the line with CIVICRM_UF_DSN in the CiviCRM files), and you need the two CiviCRM files to agree on the CiviCRM database information (the line with CIVICRM_DSN).
  If you think you've hopelessly ruined your CiviCRM settings files, you can rebuild them from the copy at
  administrator/components/com_civicrm/civicrm/templates/CRM/common/civicrm.settings.php.template
  
  You will want to keep your existing ones handy as a guide (and a fallback in case you cause trouble), and you'll need to replace all the tokens, which appear as %%tokenname%% in the file.
  
  > **Comments:**
  > **username_0**: I deleted all the civicrm_ tables in my Joomla database. I completely uninstalled the civi components. I then reinstalled Civi from scratch. How would there be errors in a setup file that affects how CiviMail functions in a clean install? Am I missing something?  
  > **username_1**: You're right--that seems unlikely in your context.  Be aware that CiviCRM will automatically use your Joomla database when it tries to install. There may be some problem in the database itself.  You should also enable debugging: that will tell you the DB query that's failing and a bit more help.  
  
  ---
  
  