Report this

What is the reason for this report?

How to reinstall Wordpress

Posted on April 6, 2015

I accidentally remove mysql, and my Wordpress become unavailable, how to reinstall my wordpress?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Go To your droplet and in Rebuild Droplet select ubuntu WordPress option and click on rebuild

Access your Droplet Dashboard and navigate to the Destroy tab. Below the first option of Destroy you will find an additional box to rebuild the droplet to a specific image, under the name Rebuild Droplet.

**Note from the documentation below: ** “This will rebuild your Droplet using the image specified and its original configuration parameters. The rebuild process will destroy all data currently on this Droplet, so back up anything you want to keep. Rebuilds are limited to base images and snapshots in the same OS family as the Droplet.”

Hope this helps!

Heya,

If you accidentally removed MySQL but still have the data files intact, you may not need to reinstall WordPress entirely. Instead, you can try to restore your MySQL setup and reattach the existing data.

Follow these steps:

1. Reinstall MySQL:

On Ubuntu/Debian:

sudo apt update
sudo apt install mysql-server

On CentOS/RHEL:

sudo yum install mysql-server
sudo systemctl start mysqld

2. Check Data Directory:

Make sure the data directory (usually /var/lib/mysql/) still contains your database files. If you have them intact, there’s a good chance you can recover the MySQL instance without losing data.

3. Start MySQL:

Start the MySQL service and ensure it’s set to start on boot:

sudo systemctl start mysql
sudo systemctl enable mysql

4. Reconnect WordPress:

Open your wp-config.php file in the root directory of your WordPress installation and ensure the database details (DB_NAME, DB_USER, DB_PASSWORD) are correct.

5. Test:

Visit your WordPress site and see if it’s up and running.

If Data is Lost:

If you’ve lost your MySQL data or can’t restore your MySQL instance:

  1. Reinstall WordPress: You can download a fresh copy of WordPress and go through the installation process.

  2. Restore from Backup: If you have a backup of your WordPress site (including the database), restore from that backup.

  3. Setup Database:

    • Create a new database for WordPress.
    • Update wp-config.php with the new database details.
    • Visit your WordPress site and go through the installation process.
  4. Use Site Backups: If you had any plugins or services that backed up your site regularly (like UpdraftPlus, BackupBuddy, etc.), you can use those backups to restore your site after the fresh installation.

Important Notes:

  1. Always Backup: Before making any significant changes to your site or server, always backup both the site files and the database.

  2. Check Hosting Provider: If you’re using a managed host, they may have backups available that you can restore.

  3. Maintenance Mode: If you’re worried about visitors seeing your site in a broken state, you can enable maintenance mode.

By following the above steps, you should be able to get your WordPress site up and running again. If you face any specific issues, don’t hesitate to seek further guidance.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.