# MODX Cannot Connect to MySQL Using VPS Managers (Ploi, Server Avatar, Cleavr)

**URL:** <https://community.modx.com/t/modx-cannot-connect-to-mysql-using-vps-managers-ploi-server-avatar-cleavr/6430>\
**Category:** General\
**Created:** [February 20, 2023, 8:30pm UTC](https://community.modx.com/t/modx-cannot-connect-to-mysql-using-vps-managers-ploi-server-avatar-cleavr/6430 "2023-02-20T20:30:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ambaxter](https://community.modx.com/user_avatar/community.modx.com/ambaxter/32/2549_2.png) [@ambaxter](https://community.modx.com/u/ambaxter)\
**Post date:** [February 20, 2023, 8:30pm UTC](https://community.modx.com/t/modx-cannot-connect-to-mysql-using-vps-managers-ploi-server-avatar-cleavr/6430/1 "2023-02-20T20:30:40Z")

</div>

I’m posting here just in case anybody else has seen something like this: I am trying to launch MODX using Ploi and/or Cleavr which are interfaces that connect to and deploy VPS servers to multiple modern providers like Linode, Digital Ocean, Vultr, etc.

The problem I’m running into is that MODX cannot connect to the MySQL database on any of these setups. They’re running NGINX on Ubuntu 20.04 with MySQL 8 and PHP 7.4.

**I can connect using PHP myadmin, and Wordpress works without a problem.** But during installation, MODX can never ever connect to the db. Is there something that I need to change in an LEMP setup to allow MODx to connect to MySQL?

---

<div class="post-metadata">

**Author:** ![camicase82](https://community.modx.com/user_avatar/community.modx.com/camicase82/32/2033_2.png) [@camicase82](https://community.modx.com/u/camicase82)\
**Post date:** [February 21, 2023, 3:00pm UTC](https://community.modx.com/t/modx-cannot-connect-to-mysql-using-vps-managers-ploi-server-avatar-cleavr/6430/2 "2023-02-21T15:00:57Z")

</div>

Hi, there’s nothing particular on MODX installation that would case connection issues beyond config params, are you sure the DB server is visible on the PHP side using the exact same data you are using on the installer? try a simple connect/query script and see what errors are you getting, and you can go from there

---

<div class="post-metadata">

**Author:** ![pfeifakopf](https://community.modx.com/letter_avatar_proxy/v4/letter/p/8e7dd6/32.png) [@pfeifakopf](https://community.modx.com/u/pfeifakopf)\
**Post date:** [June 27, 2023, 11:38am UTC](https://community.modx.com/t/modx-cannot-connect-to-mysql-using-vps-managers-ploi-server-avatar-cleavr/6430/3 "2023-06-27T11:38:58Z")

</div>

Hey, did you find a solution? I have the same issue…

---

<div class="post-metadata">

**Author:** ![ambaxter](https://community.modx.com/user_avatar/community.modx.com/ambaxter/32/2549_2.png) [@ambaxter](https://community.modx.com/u/ambaxter)\
**Post date:** [June 27, 2023, 3:38pm UTC](https://community.modx.com/t/modx-cannot-connect-to-mysql-using-vps-managers-ploi-server-avatar-cleavr/6430/4 "2023-06-27T15:38:06Z")

</div>

@pfeifakopf I did solve it.

I had to create the MySQL user and assign all database permissions manually. This can be done in command line or by installing PHPMyAdmin.

In the dashbaord of these modern hosting platforms, you can see the user being created. But they do not `GRANT` permissions or allow you to manage db permissions from the UI. This is by design and I have confirmed with their support teams. See the following note from Cleavr support. I think it would be nice if they made that clear. But in my testing of all of them, I never saw that information published anywhere.

> Ah! Yeah, we don’t allow for changing permissions to db users via the dashboard, generally. As we don’t like the potential security risks. You’d need to update permissions via **SSH terminal.**

---

<div class="post-metadata">

**Author:** ![pfeifakopf](https://community.modx.com/letter_avatar_proxy/v4/letter/p/8e7dd6/32.png) [@pfeifakopf](https://community.modx.com/u/pfeifakopf)\
**Post date:** [June 28, 2023, 6:27pm UTC](https://community.modx.com/t/modx-cannot-connect-to-mysql-using-vps-managers-ploi-server-avatar-cleavr/6430/5 "2023-06-28T18:27:31Z")

</div>

Thanks for your help. The connection to the database works fine now. Last problem that I have is, that I don’t get mod\_rewrite working with nginx. How did you solve this?

---

<div class="post-metadata">

**Author:** ![ambaxter](https://community.modx.com/user_avatar/community.modx.com/ambaxter/32/2549_2.png) [@ambaxter](https://community.modx.com/u/ambaxter)\
**Post date:** [June 28, 2023, 6:40pm UTC](https://community.modx.com/t/modx-cannot-connect-to-mysql-using-vps-managers-ploi-server-avatar-cleavr/6430/6 "2023-06-28T18:40:14Z")

</div>

I believe that’s where I hit a wall. I never got that working. After 21 days of working through the bugs, I just moved all of my MODX instances back to cPanel.

---

<div class="post-metadata">

**Author:** ![pfeifakopf](https://community.modx.com/letter_avatar_proxy/v4/letter/p/8e7dd6/32.png) [@pfeifakopf](https://community.modx.com/u/pfeifakopf)\
**Post date:** [June 28, 2023, 7:17pm UTC](https://community.modx.com/t/modx-cannot-connect-to-mysql-using-vps-managers-ploi-server-avatar-cleavr/6430/7 "2023-06-28T19:17:13Z")

</div>

Ah, OK. My sites are working without seo friendly urls. Here is an example for the nginx config, but right know I don’t get it.

[https://docs.modx.com/3.x/en/getting-started/friendly-urls/nginx](https://docs.modx.com/3.x/en/getting-started/friendly-urls/nginx)

---

<div class="post-metadata">

**Author:** ![system](https://community.modx.com/user_avatar/community.modx.com/system/32/2_2.png) [@system](https://community.modx.com/u/system)\
**Post date:** [June 30, 2023, 7:17pm UTC](https://community.modx.com/t/modx-cannot-connect-to-mysql-using-vps-managers-ploi-server-avatar-cleavr/6430/8 "2023-06-30T19:17:16Z")

</div>

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.
