Answers.Body: <p>The answer to the question about the syntax needed on install when wanting a separate database is as follows. I struggled with this myself today, which was on a Drupal 7 site.</p>
  <p>mysql://example_dbuser:password@localhost/example_dbname</p>
  <p>where of course example_dbuser is the user name, password is the password without special characters and example_dbname is the separate civicrm database name.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-23T21:23:15.467Z
Answers.LastActivityDate: 2023-01-23T21:23:15.467Z
Answers.UserDisplayName: Andy Clark
Answers.Body: <p>My problem turned out to be special characters in the password. Once I changed the password the connection worked fine. To connect to the database, I just changed the path in this line in civicrm-settings.php file to:</p>
  <p>define('CIVICRM_DSN', 'mysql://username:password@localhost:3306/databasename?new_link=true');</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-03T16:27:45.593Z
Answers.Text: Thanks for your answer, but this sounds like the answer to a different question. Did you mean to post it as an answer to your question? https://civicrm.stackexchange.com/questions/39970/cant-connect-to-separate-database
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-31T17:09:34.273Z
Answers.LastActivityDate: 2021-08-31T17:09:34.273Z
Answers.UserDisplayName: Scarlett
Body: <p>I am installing Civi on localhhost. I  want to set up a database separate to Wordpress. I am using these credentials: mysql://root:HIDDEN@localhost/cividata. The database username is root, without a password. I get the same issue as described here; <a href="https://civicrm.stackexchange.com/questions/39970/cant-connect-to-separate-database">Can&#39;t connect to separate database</a>. Would it be possible for someone to tell me what the correct syntax should be? Instead of HIDDEN should I use '' Thanks.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-30T20:37:35.743Z
Comments.Text: Can you try mysql://root:@localhost/cividata
  I would guess it should work with nothing between : and @
Comments.UserDisplayName: samuelsov
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-31T13:16:41.317Z
Comments.Text: "Can you try mysql://root:@localhost/cividata I would guess it should work with nothing between : and @"
  
  If that doesn't work, actually lose the ellipse.
  mysql://root@localhost/cividata
Comments.UserDisplayName: Karl Tatgenhorst
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-09-04T22:53:49.293Z
Comments.Text: Thanks for the answers. I set a password for the database and used that in the login script. I still haven't figured out how to do it without a password.
Comments.UserDisplayName: Phillip Money
Tags: <wordpress><installation><mysql><passwords>
Title: Civicrm separate database login syntax
ThreadText: # Civicrm separate database login syntax
  
  (Asked by: username_0 on 2021-08-29)
  
  I am installing Civi on localhhost. I want to set up a database separate to Wordpress. I am using these credentials: mysql://root:HIDDEN@localhost/cividata. The database username is root, without a password. I get the same issue as described here; [Can't connect to separate database](https://civicrm.stackexchange.com/questions/39970/cant-connect-to-separate-database). Would it be possible for someone to tell me what the correct syntax should be? Instead of HIDDEN should I use '' Thanks.
  
  **Tags:** wordpress, installation, mysql, passwords
  
  > **Comments:**
  > **username_1**: Can you try mysql://root:@localhost/cividata I would guess it should work with nothing between : and @  
  > **username_2**: "Can you try mysql://root:@localhost/cividata I would guess it should work with nothing between : and @"  If that doesn't work, actually lose the ellipse. mysql://root@localhost/cividata  
  > **username_0**: Thanks for the answers. I set a password for the database and used that in the login script. I still haven't figured out how to do it without a password.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2023-01-23. Score: 0
  
  The answer to the question about the syntax needed on install when wanting a separate database is as follows. I struggled with this myself today, which was on a Drupal 7 site.
  
  mysql://example\_dbuser:password@localhost/example\_dbname
  
  where of course example\_dbuser is the user name, password is the password without special characters and example\_dbname is the separate civicrm database name.
  
  
  ---
  
  ### Answer by username_4 on 2021-08-31. Score: 0
  
  My problem turned out to be special characters in the password. Once I changed the password the connection worked fine. To connect to the database, I just changed the path in this line in civicrm-settings.php file to:
  
  define('CIVICRM\_DSN', 'mysql://username:password@localhost:3306/databasename?new\_link=true');
  
  > **Comments:**
  > **username_5**: Thanks for your answer, but this sounds like the answer to a different question. Did you mean to post it as an answer to your question? https://civicrm.stackexchange.com/questions/39970/cant-connect-to-separate-database  
  
  ---
  
  