How to re-install MySQL


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » MySQL / MariaDB

How to re-install MySQLLast Modified: Jul 30, 2017, 9:54 pm

Before doing anything

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

1) If MySQL needs to be re-installed, or wasn't installed the first time for some reason, you can re-install it with this guide.  It will remove all old databases, so if you have data, make sure you back it up.

cd /usr/local/directadmin/scripts
./mysql.sh rootpass da_admin daadminpass

where you'd change the passwords to any value that you'd like.
The installer uses the mysql= value for the rootpass, and the adminpass= for the adminpass, both from the setup.txt (same directory).

It may ask you:

It seems as though mysql has already been installed.
The directory /var/lib/mysql has been found.  For the best results, its recommended that this be deleted.
All database data will be lost if you delete it

Do you want to delete it? (y is recommended)? (y,n) :

where you'd want to answer "y" to get a clean start.
If you select "n", then the installer will fail unless the active database allows logins without any passwords. (just answer: y)


2) If you need to use RoundCube, then re-install that too:

cd /usr/local/directadmin/custombuild
./build roundcube





Install MariaDB instead

If the previous install defaults to MySQL and you want to wipe it for a specific version of MariaDB, you'd need to delete the MySQL*.rpm files, from and replace them with the MariaDB rpms before running the mysql.sh, above.  You'll also need to remove the MySQL* rpms from the system after you're done creating the backups.

Adjust these values to make copy/paste quicker:
Major version:
Full version:
Architechture:
Feel free to browse http://files.directadmin.com/services/all/mariadb/to find the files for your system.
Set the values above, then run:

cd /usr/local/directadmin/scripts/packages
rm -f MySQL*.rpm
wget http://files.directadmin.com/services/all/mariadb/10.1/10.1.25/MariaDB-10.1.25-centos7-x86_64-server.rpm
wget http://files.directadmin.com/services/all/mariadb/10.1/10.1.25/MariaDB-10.1.25-centos7-x86_64-client.rpm
wget http://files.directadmin.com/services/all/mariadb/10.1/10.1.25/MariaDB-10.1.25-centos7-x86_64-devel.rpm
wget http://files.directadmin.com/services/all/mariadb/10.1/10.1.25/MariaDB-10.1.25-centos7-x86_64-shared.rpm
wget http://files.directadmin.com/services/all/mariadb/10.1/10.1.25/MariaDB-10.1.25-centos7-x86_64-common.rpm
wget http://files.directadmin.com/services/all/mariadb/10.1/10.1.25/MariaDB-10.1.25-centos7-x86_64-compat.rpm

Ensure you've got all your backups ready to go, and remove the MySQL rpms:

rpm -e `rpm -qa | grep MySQL`

now you can go to step #1 above to install the MariaDB rpms.

2003 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST