From aaca8c712f3b5c48b10bf350938587cfa05c21d8 Mon Sep 17 00:00:00 2001 From: Cipriano Groenendal Date: Fri, 10 Feb 2023 14:22:18 +0100 Subject: [PATCH 1/7] Update how-to-use-mysql-on-hypernode.md --- .../mysql/how-to-use-mysql-on-hypernode.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md b/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md index 79f9814e..d2f5a2bc 100644 --- a/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md +++ b/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md @@ -49,7 +49,7 @@ Port 3306 is fire-walled on all Hypernodes to prevent hackers and bruteforces fr First check which IP addresses have been whitelisted already, if any. -```nginx +```bash hypernode-systemctl whitelist get ``` @@ -57,7 +57,7 @@ hypernode-systemctl whitelist get To add more values to your whitelists you can run the following. Please note that descriptions are optional: -```nginx +```bash hypernode-systemctl whitelist add database 1.2.3.4 --description "my description" ``` @@ -65,18 +65,18 @@ hypernode-systemctl whitelist add database 1.2.3.4 --description "my description To remove values from your whitelists you can run the following: -```nginx +```bash hypernode-systemctl whitelist remove database 1.2.3.4 ``` -### Whitelist via Your Service Panel +### Whitelist via the Control Panel -Only our Service Panel users have the option to whitelist an IP via the Service Panel. +It's also possible to whitelist an IP address via the Control Panel -1. Log on to your [Service Panel](https://auth.byte.nl). +1. Log on to the [Control Panel](https://my.hypernode.com). 1. Select your Hypernode. -1. Go to `Instellingen` > `Externe database toegang`. -1. Add the IP addresses to the firewall whitelist. +1. Select `Allowlist` from the menu. +1. Add the IP addresses to the database allowlist. ## How to Connect to MySQL From d4f6ba51fcf721523dd8178df18c7bb35ed8809f Mon Sep 17 00:00:00 2001 From: Cipriano Groenendal Date: Mon, 13 Feb 2023 10:03:21 +0100 Subject: [PATCH 2/7] Update how-to-use-mysql-on-hypernode.md --- .../mysql/how-to-use-mysql-on-hypernode.md | 66 ++++++++----------- 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md b/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md index d2f5a2bc..3bde4780 100644 --- a/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md +++ b/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md @@ -21,11 +21,11 @@ Your MySQL credentials are stored in the homedir of application user. You find them in the file `.my.cnf` located in `/data/web`. -```nginx +```bash cat ~/.my.cnf ``` -```nginx +```ini [client] user = app password = JlogA1Sws6XMHmAj7QlP9vpfjlprtpE5 @@ -49,7 +49,7 @@ Port 3306 is fire-walled on all Hypernodes to prevent hackers and bruteforces fr First check which IP addresses have been whitelisted already, if any. -```bash +```console hypernode-systemctl whitelist get ``` @@ -57,7 +57,7 @@ hypernode-systemctl whitelist get To add more values to your whitelists you can run the following. Please note that descriptions are optional: -```bash +```console hypernode-systemctl whitelist add database 1.2.3.4 --description "my description" ``` @@ -65,7 +65,7 @@ hypernode-systemctl whitelist add database 1.2.3.4 --description "my description To remove values from your whitelists you can run the following: -```bash +```console hypernode-systemctl whitelist remove database 1.2.3.4 ``` @@ -86,7 +86,7 @@ Because we’ve provided a `~/.my.cnf`, you’re all set to go. Just type `mysql` and you’re in. -```nginx +```console mysql ``` @@ -94,7 +94,7 @@ mysql Use your credentials to connect like so: -```nginx +```console mysql --host=mysqlmaster.example.hypernode.io --user=app --password=mypassword ``` @@ -111,7 +111,7 @@ If you are blocked by a firewall, you can tunnel the remote MySQL service to you Use this command: -```nginx +```console ssh -NL 3306:mysqlmaster:3306 app@example.hypernode.io ``` @@ -123,7 +123,7 @@ Voila, now your Hypernode database is reachable through localhost port 3306! Use the following command using SSH: -```nginx +```console magerun db:dump -n -c gz -s @stripped ``` @@ -156,7 +156,7 @@ Hypernode offers several version of MySQL to be able to meet te requirements of To upgrade your MySQL version you can use[the hypernode-systemctl tool](../tools/how-to-use-the-hypernode-systemctl-cli-tool.md#mysql) through the command line. -```nginx +```console hypernode-systemctl settings mysql_version --value 5.7 ``` @@ -164,8 +164,8 @@ hypernode-systemctl settings mysql_version --value 5.7 To create a new database, we’ll login using the MySQL client and drop the database using the command line. -```nginx ->DATABASE="new_database" +```bash +DATABASE="new_database" mysql -e "CREATE DATABASE IF NOT EXISTS $DATABASE" ``` @@ -184,7 +184,7 @@ To prevent incorrect deletion of database that are still in use, ensure yourself When you are 100% sure it is safe to delete the database, issue the following command: -```nginx +```bash DATABASE="old_database" mysql -e "DROP DATABASE $DATABASE" ``` @@ -198,7 +198,7 @@ If you truncate a database table, all records are removed but the table structur After you ensured yourself it is safe to delete all records of the table, use the following command: -```nginx +```bash DATABASE="magento" TABLE="core_url_rewrite" mysql "$DATABASE" -e "TRUNCATE TABLE $TABLE" @@ -208,37 +208,31 @@ mysql "$DATABASE" -e "TRUNCATE TABLE $TABLE" Login to your MySQL server via the following command: -```nginx +```console mysql ``` -This will get you into the MySQL prompt. Select the database which holds user accounts, here it’s called mysql; +This will get you into the MySQL prompt. Now change the password for a given user account using this command: -```nginx -use mysql; -``` - -Now change the password for a given user account using this command: - -```nginx +```mysql update user set password=PASSWORD('newpassword') where user='username'; ``` Let’s assume here that your username is ‘trial’ and your new password is ‘hypernode’. Your actual command would look like this: -```nginx +```mysql update user set password=PASSWORD('hypernode') where user='trial'; ``` Now your password is changed in the database, but they haven’t filtered into memory yet. Change that by typing: -```nginx +```mysql flush privileges; ``` Your password has been updated. There’s no need to restart the MySQL demon. Exit the MySQL with -```nginx +```mysql exit; ``` @@ -250,7 +244,7 @@ exit; You can upgrade the MySQL version on your Hypernode from 5.6 to 5.7 with the following command: -```nginx +```bash hypernode-systemctl settings mysql_version 5.7 ``` @@ -260,31 +254,25 @@ You can then check with `livelog` when the process has finished and your MySQL v Login to your MySQL server via the following command -```nginx +```console mysql ``` -This will get you into the MySQL prompt. Select the database which holds user accounts, here it’s called mysql; - -```nginx -use mysql; -``` - -Now change the password for a given user account using this command, in this case the `app` user: +This will get you into the MySQL prompt. Now change the password for a given user account using this command, in this case the `app` user: -```nginx +```mysql update user set authentication_string=password('newpassword') where user='app'; ``` Now your password is changed in the database, but they haven’t filtered into memory yet. Change that by typing: -```nginx +```mysql flush privileges; ``` Your password has been updated. There’s no need to restart the MySQL demon. Exit the MySQL with -```nginx +```mysql exit; ``` @@ -296,7 +284,7 @@ Remember to update your `~/.my.cnf` with your new password so you could easily l Before you can upgrade to MySQL 8.0 you first need to upgrade the MySQL version to 5.7 and wait for this process to finish. Once You can upgrade the MySQL version on your Hypernode from 5.7 to 8.0 with the following command: -```nginx +```console hypernode-systemctl settings mysql_version 8.0 ``` From 31fb7631ae95e37217040cbd70d67f09b5d78fb5 Mon Sep 17 00:00:00 2001 From: Cipriano Groenendal Date: Mon, 13 Feb 2023 10:43:45 +0100 Subject: [PATCH 3/7] Update how-to-use-mysql-on-hypernode.md --- .../mysql/how-to-use-mysql-on-hypernode.md | 110 ++++++++++-------- 1 file changed, 60 insertions(+), 50 deletions(-) diff --git a/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md b/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md index 3bde4780..20903a87 100644 --- a/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md +++ b/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md @@ -13,7 +13,7 @@ redirect_from: # How to Use Mysql on Hypernode -This article explains how to use MySQL on Hypernode, from finding your credentials, whitelisting your IP address to using PHPMyAdmin. +This article explains how to use MySQL on Hypernode, from finding your credentials, allowlisting your IP address, to using PHPMyAdmin. ## Finding Your Credentials @@ -35,17 +35,17 @@ host = mysqlmaster.example.hypernode.io ## What You Should Know - There is no predefined database, so you should create your own. -- The `app`user is the local superuser. This means you can (among other things): - - Can create your own databases; - - Create users; +- The `app` user is the local superuser. This means you can (among other things): + - Create your own databases; + - Create users and manage passwords; - Define views and triggers. -- If you want to use a GUI to work on your database we recommend using a local GUI ([HeidiSQL](../../best-practices/database/how-to-use-heidisql-on-hypernode.md)) instead of an online GUI ([PHPMyAdmin](../mysql/how-to-use-phpmyadmin.md)). +- If you want to use a GUI to work on your database we recommend using a local GUI (Such as [HeidiSQL](../../best-practices/database/how-to-use-heidisql-on-hypernode.md) on Windows) instead of an online GUI ([PHPMyAdmin](../mysql/how-to-use-phpmyadmin.md)). ## Whitelisting Your IP Address -Port 3306 is fire-walled on all Hypernodes to prevent hackers and bruteforces from connecting to your MySQL instance. That's why if you want to externally connect to MySQL on the Hypernode, you’ll need to add a whitelisting entry first. +Port 3306 is firewalled on all Hypernodes to prevent hackers and bruteforces from connecting to your MySQL instance. That's why if you want to externally connect to MySQL on the Hypernode, you’ll need to add the remote IP address to the allowlist first. -### Whitelist via the hypernode-systemctl CLI Tool +### Allow an IP via the hypernode-systemctl CLI tool First check which IP addresses have been whitelisted already, if any. @@ -53,23 +53,23 @@ First check which IP addresses have been whitelisted already, if any. hypernode-systemctl whitelist get ``` -### Adding to Whitelist +### Adding to the Allowlist -To add more values to your whitelists you can run the following. Please note that descriptions are optional: +To add more values to your allowlist you can run the following. Please note that descriptions are optional: ```console -hypernode-systemctl whitelist add database 1.2.3.4 --description "my description" +hypernode-systemctl whitelist add database 203.0.113.4 --description "my description" ``` -### Removing From Whitelist +### Removing From the Allowlist -To remove values from your whitelists you can run the following: +To remove IP addresses from your allowlists you can run the following: ```console -hypernode-systemctl whitelist remove database 1.2.3.4 +hypernode-systemctl whitelist remove database 203.0.113.4 ``` -### Whitelist via the Control Panel +### Manage the Allowlist via the Control Panel It's also possible to whitelist an IP address via the Control Panel @@ -98,16 +98,18 @@ Use your credentials to connect like so: mysql --host=mysqlmaster.example.hypernode.io --user=app --password=mypassword ``` +Please note you will need to add the remote host's IP address to the allowlist first, as described above. + ### Using HeidiSQL/PHPMyAdmin to Connect to MySQL Read the following articles on how to use both HeidiSQL and PHPMyAdmin for Hypernode: -- Using HeidiSQL -- Using PHPMyAdmin +- Using [HeidiSQL](../../best-practices/database/how-to-use-heidisql-on-hypernode.md +- Using [PHPMyAdmin](../mysql/how-to-use-phpmyadmin.md) ### Using an SSH Tunnel to Circumvent Firewalls -If you are blocked by a firewall, you can tunnel the remote MySQL service to your local computer (Mac or Linux). +If you are blocked by a firewall, you can create a temporary tunnel between the remote MySQL service and your local computer. Use this command: @@ -154,7 +156,7 @@ You should consider using Magerun (see above), but you could use HeidiSQL to cre Hypernode offers several version of MySQL to be able to meet te requirements of several Magento, Shopware and Akeneo versions. For example, if you want to install Magento 2.4, you'd have to run MySQL 5.7 or 8.0. -To upgrade your MySQL version you can use[the hypernode-systemctl tool](../tools/how-to-use-the-hypernode-systemctl-cli-tool.md#mysql) through the command line. +To upgrade your MySQL version you can use [the hypernode-systemctl tool](../tools/how-to-use-the-hypernode-systemctl-cli-tool.md#mysql) through the command line. ```console hypernode-systemctl settings mysql_version --value 5.7 @@ -162,7 +164,7 @@ hypernode-systemctl settings mysql_version --value 5.7 ### How to Create a New Database -To create a new database, we’ll login using the MySQL client and drop the database using the command line. +To create a new database, we’ll login using the MySQL client and create the database using the command line. ```bash DATABASE="new_database" @@ -179,7 +181,7 @@ To prevent incorrect deletion of database that are still in use, ensure yourself - The database is not used anymore by checking it’s content. - The database is not defined in your application configuration anymore. - (IE: Check the `local.xml` and/or your `wp-config.php).` + (IE: Check the `local.xml`, `env.php`, and/or your `wp-config.php). - You created a backup to ensure yourself you are able to restore the database if necessary. When you are 100% sure it is safe to delete the database, issue the following command: @@ -204,7 +206,11 @@ TABLE="core_url_rewrite" mysql "$DATABASE" -e "TRUNCATE TABLE $TABLE" ``` -### Changing Your MySQL 5.6 Password +## Changing Your Password + +How you change the database password depends on what version of MySQL you are running on your Hypernode. + +### Changing Your Password on MySQL 5.6 Login to your MySQL server via the following command: @@ -212,45 +218,41 @@ Login to your MySQL server via the following command: mysql ``` -This will get you into the MySQL prompt. Now change the password for a given user account using this command: +This will get you into the MySQL prompt. In this example we change the password for the `app` user to `p4ssw0rd` ```mysql -update user set password=PASSWORD('newpassword') where user='username'; +SET PASSWORD FOR 'app'@'%' = PASSWORD("p4ssw0rd"); ``` -Let’s assume here that your username is ‘trial’ and your new password is ‘hypernode’. Your actual command would look like this: +Your password has been updated. There’s no need to restart the MySQL demon. Exit the MySQL with ```mysql -update user set password=PASSWORD('hypernode') where user='trial'; +exit; ``` -Now your password is changed in the database, but they haven’t filtered into memory yet. Change that by typing: +### Changing Your Password on MySQL 5.7 -```mysql -flush privileges; +Login to your MySQL server via the following command + +```console +mysql ``` -Your password has been updated. There’s no need to restart the MySQL demon. Exit the MySQL with +This will get you into the MySQL prompt. In this example we change the password for the `app` user to `p4ssw0rd` ```mysql -exit; +ALTER USER `app` IDENTIFIED BY 'p4ssw0rd'; ``` -## How to Upgrade Your MySQL Version - -### Upgrading to MySQL 5.7 - -**Please note that once you have upgraded the MySQL version on your Hypernode, you won't be able to downgrade it.** - -You can upgrade the MySQL version on your Hypernode from 5.6 to 5.7 with the following command: +Your password has been updated. There’s no need to restart the MySQL demon. Exit the MySQL with -```bash -hypernode-systemctl settings mysql_version 5.7 +```mysql +exit; ``` -You can then check with `livelog` when the process has finished and your MySQL version has been upgraded. +Remember to update your `~/.my.cnf` with your new password so you could easily login your MySQL-CLI without entering the password each time. -### Changing Your MySQL 5.7 Password +### Changing Your Password on MySQL 8.0 Login to your MySQL server via the following command @@ -258,16 +260,10 @@ Login to your MySQL server via the following command mysql ``` -This will get you into the MySQL prompt. Now change the password for a given user account using this command, in this case the `app` user: +This will get you into the MySQL prompt. In this example we change the password for the `app` user to `p4ssw0rd` ```mysql -update user set authentication_string=password('newpassword') where user='app'; -``` - -Now your password is changed in the database, but they haven’t filtered into memory yet. Change that by typing: - -```mysql -flush privileges; +ALTER USER `app` IDENTIFIED BY 'p4ssw0rd'; ``` Your password has been updated. There’s no need to restart the MySQL demon. Exit the MySQL with @@ -278,11 +274,25 @@ exit; Remember to update your `~/.my.cnf` with your new password so you could easily login your MySQL-CLI without entering the password each time. +## How to Upgrade Your MySQL Version + +### Upgrading to MySQL 5.7 + +**Please note that once you have upgraded the MySQL version on your Hypernode, you won't be able to downgrade it.** + +You can upgrade the MySQL version on your Hypernode from 5.6 to 5.7 with the following command: + +```console +hypernode-systemctl settings mysql_version 5.7 +``` + +You can then check with `livelog` when the process has finished and your MySQL version has been upgraded. + ### Upgrading to MySQL 8.0 **Please note that once you have upgraded the MySQL version on your Hypernode, you won't be able to downgrade it.** -Before you can upgrade to MySQL 8.0 you first need to upgrade the MySQL version to 5.7 and wait for this process to finish. Once You can upgrade the MySQL version on your Hypernode from 5.7 to 8.0 with the following command: +Before you can upgrade to MySQL 8.0 you first need to upgrade the MySQL version to 5.7 and wait for this process to finish. Once that is done, you can upgrade the MySQL version on your Hypernode from 5.7 to 8.0 with the following command: ```console hypernode-systemctl settings mysql_version 8.0 From 6c4d0f64a4d6aed0b7de274e2c2a4ee98e090bcb Mon Sep 17 00:00:00 2001 From: Cipriano Groenendal Date: Mon, 13 Feb 2023 10:44:44 +0100 Subject: [PATCH 4/7] Update how-to-use-mysql-on-hypernode.md --- .../mysql/how-to-use-mysql-on-hypernode.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md b/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md index 20903a87..cf44d076 100644 --- a/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md +++ b/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md @@ -49,7 +49,7 @@ Port 3306 is firewalled on all Hypernodes to prevent hackers and bruteforces fro First check which IP addresses have been whitelisted already, if any. -```console +```bash hypernode-systemctl whitelist get ``` @@ -57,7 +57,7 @@ hypernode-systemctl whitelist get To add more values to your allowlist you can run the following. Please note that descriptions are optional: -```console +```bash hypernode-systemctl whitelist add database 203.0.113.4 --description "my description" ``` @@ -65,7 +65,7 @@ hypernode-systemctl whitelist add database 203.0.113.4 --description "my descrip To remove IP addresses from your allowlists you can run the following: -```console +```bash hypernode-systemctl whitelist remove database 203.0.113.4 ``` @@ -86,7 +86,7 @@ Because we’ve provided a `~/.my.cnf`, you’re all set to go. Just type `mysql` and you’re in. -```console +```bash mysql ``` @@ -94,7 +94,7 @@ mysql Use your credentials to connect like so: -```console +```bash mysql --host=mysqlmaster.example.hypernode.io --user=app --password=mypassword ``` @@ -113,7 +113,7 @@ If you are blocked by a firewall, you can create a temporary tunnel between the Use this command: -```console +```bash ssh -NL 3306:mysqlmaster:3306 app@example.hypernode.io ``` @@ -125,7 +125,7 @@ Voila, now your Hypernode database is reachable through localhost port 3306! Use the following command using SSH: -```console +```bash magerun db:dump -n -c gz -s @stripped ``` @@ -158,7 +158,7 @@ Hypernode offers several version of MySQL to be able to meet te requirements of To upgrade your MySQL version you can use [the hypernode-systemctl tool](../tools/how-to-use-the-hypernode-systemctl-cli-tool.md#mysql) through the command line. -```console +```bash hypernode-systemctl settings mysql_version --value 5.7 ``` @@ -214,7 +214,7 @@ How you change the database password depends on what version of MySQL you are ru Login to your MySQL server via the following command: -```console +```bash mysql ``` @@ -234,7 +234,7 @@ exit; Login to your MySQL server via the following command -```console +```bash mysql ``` @@ -256,7 +256,7 @@ Remember to update your `~/.my.cnf` with your new password so you could easily l Login to your MySQL server via the following command -```console +```bash mysql ``` @@ -282,7 +282,7 @@ Remember to update your `~/.my.cnf` with your new password so you could easily l You can upgrade the MySQL version on your Hypernode from 5.6 to 5.7 with the following command: -```console +```bash hypernode-systemctl settings mysql_version 5.7 ``` @@ -294,7 +294,7 @@ You can then check with `livelog` when the process has finished and your MySQL v Before you can upgrade to MySQL 8.0 you first need to upgrade the MySQL version to 5.7 and wait for this process to finish. Once that is done, you can upgrade the MySQL version on your Hypernode from 5.7 to 8.0 with the following command: -```console +```bash hypernode-systemctl settings mysql_version 8.0 ``` From 3e45fd30e06a1193335982f32eb82f2fa6f511b0 Mon Sep 17 00:00:00 2001 From: Cipriano Groenendal Date: Mon, 13 Feb 2023 11:02:36 +0100 Subject: [PATCH 5/7] Update how-to-use-mysql-on-hypernode.md --- .../mysql/how-to-use-mysql-on-hypernode.md | 75 ++++++++++--------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md b/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md index cf44d076..3b9208ec 100644 --- a/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md +++ b/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md @@ -41,42 +41,6 @@ host = mysqlmaster.example.hypernode.io - Define views and triggers. - If you want to use a GUI to work on your database we recommend using a local GUI (Such as [HeidiSQL](../../best-practices/database/how-to-use-heidisql-on-hypernode.md) on Windows) instead of an online GUI ([PHPMyAdmin](../mysql/how-to-use-phpmyadmin.md)). -## Whitelisting Your IP Address - -Port 3306 is firewalled on all Hypernodes to prevent hackers and bruteforces from connecting to your MySQL instance. That's why if you want to externally connect to MySQL on the Hypernode, you’ll need to add the remote IP address to the allowlist first. - -### Allow an IP via the hypernode-systemctl CLI tool - -First check which IP addresses have been whitelisted already, if any. - -```bash -hypernode-systemctl whitelist get -``` - -### Adding to the Allowlist - -To add more values to your allowlist you can run the following. Please note that descriptions are optional: - -```bash -hypernode-systemctl whitelist add database 203.0.113.4 --description "my description" -``` - -### Removing From the Allowlist - -To remove IP addresses from your allowlists you can run the following: - -```bash -hypernode-systemctl whitelist remove database 203.0.113.4 -``` - -### Manage the Allowlist via the Control Panel - -It's also possible to whitelist an IP address via the Control Panel - -1. Log on to the [Control Panel](https://my.hypernode.com). -1. Select your Hypernode. -1. Select `Allowlist` from the menu. -1. Add the IP addresses to the database allowlist. ## How to Connect to MySQL @@ -98,7 +62,7 @@ Use your credentials to connect like so: mysql --host=mysqlmaster.example.hypernode.io --user=app --password=mypassword ``` -Please note you will need to add the remote host's IP address to the allowlist first, as described above. +Please note you will need to add the remote host's IP address to the allowlist first, as described below ### Using HeidiSQL/PHPMyAdmin to Connect to MySQL @@ -119,6 +83,43 @@ ssh -NL 3306:mysqlmaster:3306 app@example.hypernode.io Voila, now your Hypernode database is reachable through localhost port 3306! +## Allowlisting Your IP Address + +Port 3306 is firewalled on all Hypernodes to prevent hackers and bruteforces from connecting to your MySQL instance. That's why if you want to externally connect to MySQL on the Hypernode, you’ll need to add the remote IP address to the allowlist first. + +### Allow an IP via the hypernode-systemctl CLI tool + +First check which IP addresses have been whitelisted already, if any. + +```bash +hypernode-systemctl whitelist get +``` + +### Adding to the Allowlist + +To add more values to your allowlist you can run the following. Please note that descriptions are optional: + +```bash +hypernode-systemctl whitelist add database 203.0.113.4 --description "my description" +``` + +### Removing From the Allowlist + +To remove IP addresses from your allowlists you can run the following: + +```bash +hypernode-systemctl whitelist remove database 203.0.113.4 +``` + +### Manage the Allowlist via the Control Panel + +It's also possible to whitelist an IP address via the Control Panel + +1. Log on to the [Control Panel](https://my.hypernode.com). +1. Select your Hypernode. +1. Select `Allowlist` from the menu. +1. Add the IP addresses to the database allowlist. + ## Creating a MySQL Back-Up ### Using Magerun From 782591f2eda0166601486c5ba4e43167c7fa34d3 Mon Sep 17 00:00:00 2001 From: Cipriano Groenendal Date: Mon, 13 Feb 2023 12:11:59 +0100 Subject: [PATCH 6/7] chore: mdformat --- .../mysql/how-to-use-mysql-on-hypernode.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md b/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md index 3b9208ec..3584499c 100644 --- a/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md +++ b/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md @@ -41,7 +41,6 @@ host = mysqlmaster.example.hypernode.io - Define views and triggers. - If you want to use a GUI to work on your database we recommend using a local GUI (Such as [HeidiSQL](../../best-practices/database/how-to-use-heidisql-on-hypernode.md) on Windows) instead of an online GUI ([PHPMyAdmin](../mysql/how-to-use-phpmyadmin.md)). - ## How to Connect to MySQL ### Use the Command Line Shell on the Production Node @@ -68,7 +67,7 @@ Please note you will need to add the remote host's IP address to the allowlist f Read the following articles on how to use both HeidiSQL and PHPMyAdmin for Hypernode: -- Using [HeidiSQL](../../best-practices/database/how-to-use-heidisql-on-hypernode.md +- Using [HeidiSQL](../../best-practices/database/how-to-use-heidisql-on-hypernode.md) - Using [PHPMyAdmin](../mysql/how-to-use-phpmyadmin.md) ### Using an SSH Tunnel to Circumvent Firewalls @@ -182,7 +181,7 @@ To prevent incorrect deletion of database that are still in use, ensure yourself - The database is not used anymore by checking it’s content. - The database is not defined in your application configuration anymore. - (IE: Check the `local.xml`, `env.php`, and/or your `wp-config.php). + (IE: Check the configuration in you `local.xml`, `env.php`, `wp-config.php`, etc). - You created a backup to ensure yourself you are able to restore the database if necessary. When you are 100% sure it is safe to delete the database, issue the following command: From a522fac55c0b4aa7a52f10a70ad0a3a6463a96b7 Mon Sep 17 00:00:00 2001 From: Cipriano Groenendal Date: Mon, 13 Feb 2023 12:34:04 +0100 Subject: [PATCH 7/7] Remove duplicate bit --- .../mysql/how-to-use-mysql-on-hypernode.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md b/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md index 3584499c..0a8b32f3 100644 --- a/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md +++ b/docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md @@ -152,16 +152,6 @@ You should consider using Magerun (see above), but you could use HeidiSQL to cre ## Using MySQL -### How to Upgrade the MySQL Version - -Hypernode offers several version of MySQL to be able to meet te requirements of several Magento, Shopware and Akeneo versions. For example, if you want to install Magento 2.4, you'd have to run MySQL 5.7 or 8.0. - -To upgrade your MySQL version you can use [the hypernode-systemctl tool](../tools/how-to-use-the-hypernode-systemctl-cli-tool.md#mysql) through the command line. - -```bash -hypernode-systemctl settings mysql_version --value 5.7 -``` - ### How to Create a New Database To create a new database, we’ll login using the MySQL client and create the database using the command line.