The all-in-one database does not install any tools for backing up and managing the database. This article describes download a Zip archive that contains the tools necessary for backing up the database.
- Sign in interactive on the CentreStack server
- The MySQL tools require the Visual C++ 2013 Redistributable. Navigate to this page: https://support.microsoft.com/en-us/help/4032938/update-for-visual-c-2013-redistributable-package
- Download the vcredist_x64.exe package appropriate for your Locale.
- Run vcredist_x64.exe as Administrator (elevated).
- In a web browser navigate to: https://downloads.mysql.com/archives/community/
- Change the options to match this screenshot then download the mysql-5.7.22-winx64.zip Zip archive:
- This PowerShell script will validate the MD5 hash of the downloaded file, assuming the current directory in the PowerShell session is the same directory that contains the mysql-5.7.22-winx64.zip file. If the output returns True then the MD5 hash matches
$cs = '5564c05cdaab25ffd6b57144c5b3443a'
$h = Get-FileHash -Path .\mysql-5.7.22-winx64.zip -Algorithm MD5
($h.hash -eq $cs)
- Move the extracted to a location that makes sense for you. It is suggested that it reside in "C:\Program Files\MySQL\mysql-5.7.22-winx64". At some future data this path should remind you that it originated from the Zip archive and not a MySQL Installer product install.
- Open "C:\CSDBRoot\conf\initfile" in a text editor. The file will contain a single line similar to this:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'lKnoZwwi'
- The text in red between the single quotes is the password of the root user account. Copy the text (less the single quotes) to the clipboard.
- Start a command prompt (not elevated) and execute:
"C:\Program Files\MySQL\mysql-5.7.22-winx64\bin\mysql_config_editor.exe" set --host=localhost --password --user=root --port=3306
- When prompted with Enter password: paste the root user's password from "C:\CSDBRoot\conf\initfile"
- The mysql_config_editor.exe tool creates a %appdata%\MySQL\.mylogin.cnf file with the login information.
- Create this directory structure for storing CentreStack backups: C:\CSBackup\database\csmain
- Run this command to verify that the .mylogin.cnf is configured correctly:
"C:\Program Files\MySQL\mysql-5.7.22-winx64\bin\mysqldump.exe" --databases csmain --single-transaction=TRUE > C:\CSBackup\database\csmain\csmain.sql
- Verify that the "C:\CSBackup\database\csmain\csmain.sql" file was created and contains SQL statements necessary to recreate the database.
Please sign in to leave a comment.