Avatar of ITsolutionWizard
Flag for United States of America asked on

Access MySQL on Digital Ocean

I used Digital Ocean and created WordPress website as well as installed one of the WordPress that I purchased on Themeforest.net. Everything is working fine.

I just want to find out how I can access mySQL. I assume the database already installed there and I do not have to create database cluster again.

I am new there so please share with me what I should do.

Good Day


Avatar of undefined
Last Comment
Scott Fell

8/22/2022 - Mon

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Scott Fell

Because you are using Digital Ocean, chances are you are not using a panel.  You would need to install PhpMyAdmin and DO has this documented. https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-20-04  If you are using something other than Ubuntu, just click the dropdown at the top.

How did you install Wodpress?  You may have installed this already?

In Digital Ocean, I go the market place and find WordPress image and start installing.
Scott Fell

If you look at what you probably installed https://marketplace.digitalocean.com/apps/wordpress phpmyadmin is not included.  You can use the article I linked to. Pay attention to the security items.

If you are just starting out, you may want to consider using a panel as EC pointed out.  There are options for both Plesk and Cpanel.


You will see the Plesk option has everything you are looking for in that droplet. I use Plesk myself for windows. It does make managing Wordpress a little easier especially for tasks like cloning/moving.

If this is all new and since smallest digitalocean droplet is just $5. It would be well worth simultaneously spinning up a Plesk and CPanel option in addition to what you have and test them out side by side for a week. It will be much easier to switch things now than later and more than likely this is a long term option so best to get this figured out and test options now.

All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck

I actually found out how to connect MySQL in console but it is not enough. I hope to find out how to connect with workbench. I used to same credentials on workbench but it is alert invalid....
Scott Fell

As I said, Digital Ocean does a good job of documenting just about any regular task, including using Workbench. Workbench is on your local machine so there are some precautions you need to work through. That is what the help file goes through.

David Favor

You asked, "I just want to find out how I can access mySQL."

There are several potential approaches...

1) Open an ssh session, then use the mysql command line tool.

2) Or, also using ssh, use the powerful wp-cli.phar script which provides high level commands WordPress site interaction... abstracting actions related to core/theme/plugin interaction.

3) You can use phpMyAdmin, as @Scott mentioned... And I avoid phpMyAdmin, because the process of installation is horribly complex, then the update process is even more complex, so is best handled by a complete nuke os old phpMyAdmin + new install...

All of this nonsense is incredibly time consuming... and I'm lazy...

So I prefer using one of the following...

4) For WordPress sites, there's a phpMyAdmin plugin... which abstracts away the phpMyAdmin setup + update process.

Problem is, as with any database manipulation, if you crash your site, then you can fix your site using a plugin... because the site's dead...

So my preference is...

5) Using https://www.adminer.org which is, in essence, a single PHP file clone of phpMyAdmin, so no complex setup or update nonsense, just drop the file into any directory + you're good to go.
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
David Favor

Aside: If you use phpMyAdmin or Admirer, be sure to wrap both scripts in an Apache login.

Especially phpMyAdmin, which over the years has had several very bad coding problems allowing anyone to randomly access all databases, with a few keystrokes...

If you opt to use phpMyAdmin or Admirer, then best secure these, else it's likely only a matter of time till you're potentially hacked...

https://www.experts-exchange.com/questions/29208432/Docker-phpmyadmin-phpmyadmin-include-Memory-Limit-Upload-Limit-and-Max-Execution-Time.html covers the specific steps for securing phpMyAdmin + securing Admirer can be extrapolated from these instructions.

I've cleaned many sites of hacks... several 1000s of hacked sites since the 1990s...

Here's what I can say, better to never be hacked, than attempt cleansing hacked sites...

Because the Evil Army of 1,000,000s of hackers worldwide plotting your demise... well... this Army is smarter than any 1x person, so better to never all any possibility of a hack, than attempt cleansing a hack, as hack cleansing means you have to match wits with the Evil Army.

do you know how to run the command as below using digital ocean?


In general, I just need the easier way to access mySQL at Digital Ocean. I can't believe it is so hard to get connected.
MS SQL is much easier :-)
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Scott Fell

what you're really experiencing is using digitalocean which is bare-bones no desktop like Windows and you're not using a panel like plesk or cpanel. a lot of these features are done using command line and you're just not used to that.

Compare that to a Windows server where you ate using a desktop that looks very familiar because it is almost identical to your PC.

On the other hand you're not going to find a Windows server for $5 a month.

You may have to start over few times but it's worth it to go through the instructions and give it a try the worst case scenario is you wipe your droplet out and start over. as you go through that process you'll see becomes much easier