Dedicated Server How to Reinstall MySQL

Dedicated Server How to Reinstall MySQL
Dedicated Server How to Reinstall MySQL

Before doing anything

We recommend you make full DA backups on your dedicated server for easy restore, and CustomBuild mysql backups, just in case.

New Method

CustomBuild 2.0 rev 2914 on your dedicated server has the ability to very easily start with a fresh MySQL/MariaDB install of any version.

It will check to see if /var/lib/mysql exists, and if not will do a fresh install of whatever is setup in the options.conf, AND will setup your root/da_admin accounts for you.

  1. Wipe your old data. Of course this assumes you have nothing to lose, or you’ve made full .sql backups which you plan on restoring manually later on.
perl -pi -e 's/mysqld=ON/mysqld=OFF/' /usr/local/directadmin/data/admin/services.status
service mysqld stop
mv /var/lib/mysql /var/lib/mysql.old
  1. Install the new desired version, say mariadb 10.4 or mysql 5.7, for example. Except you may want to use “mysql_backup no” since mysqld isn’t running.
  2. Rebuild the RoundCube user+db:
./build roundcube
  1. Restore your .sql data, if you had any (avoid touching mysql.*, unless you know what you’re doing. Create Users through DA if you’re not confident). Read more

Don’t have dedicated server? get your own here


Leave A Comment

What’s happening in your mind about this post !

Your email address will not be published. Required fields are marked *