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. Would it be possible for someone to tell me what the correct syntax should be? Instead of HIDDEN should I use '' Thanks.
-
1Can you try mysql://root:@localhost/cividata I would guess it should work with nothing between : and @– samuelsovAug 30, 2021 at 20:37
-
"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– Karl TatgenhorstAug 31, 2021 at 13:16
-
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.– Phillip MoneySep 4, 2021 at 22:53
1 Answer
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');
-
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? civicrm.stackexchange.com/questions/39970/… Sep 3, 2021 at 16:27