You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- There is no predefined database, so you should create your own.
38
-
- The `app`user is the local superuser. This means you can (among other things):
39
-
-Can create your own databases;
40
-
- Create users;
38
+
- The `app`user is the local superuser. This means you can (among other things):
39
+
-Create your own databases;
40
+
- Create users and manage passwords;
41
41
- Define views and triggers.
42
-
- 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)).
43
-
44
-
## Whitelisting Your IP Address
45
-
46
-
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.
47
-
48
-
### Whitelist via the hypernode-systemctl CLI Tool
49
-
50
-
First check which IP addresses have been whitelisted already, if any.
51
-
52
-
```nginx
53
-
hypernode-systemctl whitelist get
54
-
```
55
-
56
-
### Adding to Whitelist
57
-
58
-
To add more values to your whitelists you can run the following. Please note that descriptions are optional:
59
-
60
-
```nginx
61
-
hypernode-systemctl whitelist add database 1.2.3.4 --description "my description"
62
-
```
63
-
64
-
### Removing From Whitelist
65
-
66
-
To remove values from your whitelists you can run the following:
Only our Service Panel users have the option to whitelist an IP via the Service Panel.
75
-
76
-
1. Log on to your [Service Panel](https://auth.byte.nl).
77
-
1. Select your Hypernode.
78
-
1. Go to `Instellingen` > `Externe database toegang`.
79
-
1. Add the IP addresses to the firewall whitelist.
42
+
- 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)).
80
43
81
44
## How to Connect to MySQL
82
45
@@ -86,44 +49,83 @@ Because we’ve provided a `~/.my.cnf`, you’re all set to go.
86
49
87
50
Just type `mysql` and you’re in.
88
51
89
-
```nginx
52
+
```bash
90
53
mysql
91
54
```
92
55
93
56
### Use the Command Line Shell From a Remote Host
94
57
95
58
Use your credentials to connect like so:
96
59
97
-
```nginx
60
+
```bash
98
61
mysql --host=mysqlmaster.example.hypernode.io --user=app --password=mypassword
99
62
```
100
63
64
+
Please note you will need to add the remote host's IP address to the allowlist first, as described below
65
+
101
66
### Using HeidiSQL/PHPMyAdmin to Connect to MySQL
102
67
103
68
Read the following articles on how to use both HeidiSQL and PHPMyAdmin for Hypernode:
104
69
105
-
- Using HeidiSQL
106
-
- Using PHPMyAdmin
70
+
- Using [HeidiSQL](../../best-practices/database/how-to-use-heidisql-on-hypernode.md)
71
+
- Using [PHPMyAdmin](../mysql/how-to-use-phpmyadmin.md)
107
72
108
73
### Using an SSH Tunnel to Circumvent Firewalls
109
74
110
-
If you are blocked by a firewall, you can tunnel the remote MySQL service to your local computer (Mac or Linux).
75
+
If you are blocked by a firewall, you can create a temporary tunnel between the remote MySQL service and your local computer.
Voila, now your Hypernode database is reachable through localhost port 3306!
119
84
85
+
## Allowlisting Your IP Address
86
+
87
+
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.
88
+
89
+
### Allow an IP via the hypernode-systemctl CLI tool
90
+
91
+
First check which IP addresses have been whitelisted already, if any.
92
+
93
+
```bash
94
+
hypernode-systemctl whitelist get
95
+
```
96
+
97
+
### Adding to the Allowlist
98
+
99
+
To add more values to your allowlist you can run the following. Please note that descriptions are optional:
100
+
101
+
```bash
102
+
hypernode-systemctl whitelist add database 203.0.113.4 --description "my description"
103
+
```
104
+
105
+
### Removing From the Allowlist
106
+
107
+
To remove IP addresses from your allowlists you can run the following:
It's also possible to whitelist an IP address via the Control Panel
116
+
117
+
1. Log on to the [Control Panel](https://my.hypernode.com).
118
+
1. Select your Hypernode.
119
+
1. Select `Allowlist` from the menu.
120
+
1. Add the IP addresses to the database allowlist.
121
+
120
122
## Creating a MySQL Back-Up
121
123
122
124
### Using Magerun
123
125
124
126
Use the following command using SSH:
125
127
126
-
```nginx
128
+
```bash
127
129
magerun db:dump -n -c gz -s @stripped
128
130
```
129
131
@@ -150,22 +152,12 @@ You should consider using Magerun (see above), but you could use HeidiSQL to cre
150
152
151
153
## Using MySQL
152
154
153
-
### How to Upgrade the MySQL Version
154
-
155
-
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.
156
-
157
-
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 create a new database, we’ll login using the MySQL client and drop the database using the command line.
157
+
To create a new database, we’ll login using the MySQL client and create the database using the command line.
166
158
167
-
```nginx
168
-
>DATABASE="new_database"
159
+
```bash
160
+
DATABASE="new_database"
169
161
mysql -e "CREATE DATABASE IF NOT EXISTS $DATABASE"
170
162
```
171
163
@@ -179,12 +171,12 @@ To prevent incorrect deletion of database that are still in use, ensure yourself
179
171
180
172
- The database is not used anymore by checking it’s content.
181
173
- The database is not defined in your application configuration anymore.
182
-
(IE: Check the `local.xml` and/or your `wp-config.php).`
174
+
(IE: Check the configuration in you `local.xml`, `env.php`, `wp-config.php`, etc).
183
175
- You created a backup to ensure yourself you are able to restore the database if necessary.
184
176
185
177
When you are 100% sure it is safe to delete the database, issue the following command:
186
178
187
-
```nginx
179
+
```bash
188
180
DATABASE="old_database"
189
181
mysql -e "DROP DATABASE $DATABASE"
190
182
```
@@ -198,105 +190,101 @@ If you truncate a database table, all records are removed but the table structur
198
190
199
191
After you ensured yourself it is safe to delete all records of the table, use the following command:
200
192
201
-
```nginx
193
+
```bash
202
194
DATABASE="magento"
203
195
TABLE="core_url_rewrite"
204
196
mysql "$DATABASE" -e "TRUNCATE TABLE $TABLE"
205
197
```
206
198
207
-
### Changing Your MySQL 5.6 Password
199
+
## Changing Your Password
200
+
201
+
How you change the database password depends on what version of MySQL you are running on your Hypernode.
202
+
203
+
### Changing Your Password on MySQL 5.6
208
204
209
205
Login to your MySQL server via the following command:
210
206
211
-
```nginx
207
+
```bash
212
208
mysql
213
209
```
214
210
215
-
This will get you into the MySQL prompt. Select the database which holds user accounts, here it’s called mysql;
211
+
This will get you into the MySQL prompt. In this example we change the password for the `app` user to `p4ssw0rd`
216
212
217
-
```nginx
218
-
use mysql;
213
+
```mysql
214
+
SET PASSWORD FOR 'app'@'%'= PASSWORD("p4ssw0rd");
219
215
```
220
216
221
-
Now change the password for a given user account using this command:
217
+
Your password has been updated. There’s no need to restart the MySQL demon. Exit the MySQL with
222
218
223
-
```nginx
224
-
update user set password=PASSWORD('newpassword') where user='username';
219
+
```mysql
220
+
exit;
225
221
```
226
222
227
-
Let’s assume here that your username is ‘trial’ and your new password is ‘hypernode’. Your actual command would look like this:
223
+
### Changing Your Password on MySQL 5.7
224
+
225
+
Login to your MySQL server via the following command
228
226
229
-
```nginx
230
-
update user set password=PASSWORD('hypernode') where user='trial';
227
+
```bash
228
+
mysql
231
229
```
232
230
233
-
Now your password is changed in the database, but they haven’t filtered into memory yet. Change that by typing:
231
+
This will get you into the MySQL prompt. In this example we change the password for the `app` user to `p4ssw0rd`
234
232
235
-
```nginx
236
-
flush privileges;
233
+
```mysql
234
+
ALTERUSER`app` IDENTIFIED BY 'p4ssw0rd';
237
235
```
238
236
239
237
Your password has been updated. There’s no need to restart the MySQL demon. Exit the MySQL with
240
238
241
-
```nginx
239
+
```mysql
242
240
exit;
243
241
```
244
242
245
-
## How to Upgrade Your MySQL Version
246
-
247
-
### Upgrading to MySQL 5.7
248
-
249
-
**Please note that once you have upgraded the MySQL version on your Hypernode, you won't be able to downgrade it.**
250
-
251
-
You can upgrade the MySQL version on your Hypernode from 5.6 to 5.7 with the following command:
252
-
253
-
```nginx
254
-
hypernode-systemctl settings mysql_version 5.7
255
-
```
256
-
257
-
You can then check with `livelog` when the process has finished and your MySQL version has been upgraded.
243
+
Remember to update your `~/.my.cnf` with your new password so you could easily login your MySQL-CLI without entering the password each time.
258
244
259
-
### Changing Your MySQL 5.7 Password
245
+
### Changing Your Password on MySQL 8.0
260
246
261
247
Login to your MySQL server via the following command
262
248
263
-
```nginx
249
+
```bash
264
250
mysql
265
251
```
266
252
267
-
This will get you into the MySQL prompt. Select the database which holds user accounts, here it’s called mysql;
253
+
This will get you into the MySQL prompt. In this example we change the password for the `app` user to `p4ssw0rd`
268
254
269
-
```nginx
270
-
use mysql;
255
+
```mysql
256
+
ALTERUSER`app` IDENTIFIED BY 'p4ssw0rd';
271
257
```
272
258
273
-
Now change the password for a given user account using this command, in this case the `app` user:
259
+
Your password has been updated. There’s no need to restart the MySQL demon. Exit the MySQL with
274
260
275
-
```nginx
276
-
update user set authentication_string=password('newpassword') where user='app';
261
+
```mysql
262
+
exit;
277
263
```
278
264
279
-
Now your password is changed in the database, but they haven’t filtered into memory yet. Change that by typing:
265
+
Remember to update your `~/.my.cnf` with your new password so you could easily login your MySQL-CLI without entering the password each time.
280
266
281
-
```nginx
282
-
flush privileges;
283
-
```
267
+
## How to Upgrade Your MySQL Version
284
268
285
-
Your password has been updated. There’s no need to restart the MySQL demon. Exit the MySQL with
269
+
### Upgrading to MySQL 5.7
286
270
287
-
```nginx
288
-
exit;
271
+
**Please note that once you have upgraded the MySQL version on your Hypernode, you won't be able to downgrade it.**
272
+
273
+
You can upgrade the MySQL version on your Hypernode from 5.6 to 5.7 with the following command:
274
+
275
+
```bash
276
+
hypernode-systemctl settings mysql_version 5.7
289
277
```
290
278
291
-
Remember to update your `~/.my.cnf` with your new password so you could easily login your MySQL-CLI without entering the password each time.
279
+
You can then check with `livelog` when the process has finished and your MySQL version has been upgraded.
292
280
293
281
### Upgrading to MySQL 8.0
294
282
295
283
**Please note that once you have upgraded the MySQL version on your Hypernode, you won't be able to downgrade it.**
296
284
297
-
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:
285
+
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:
Copy file name to clipboardExpand all lines: docs/hypernode-platform/nginx/how-to-resolve-rate-limited-requests-429-too-many-requests.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Both methods are implemented using [this module](http://nginx.org/en/docs/http/n
33
33
34
34
You can quickly determine which method of Rate Limiting was the cause of the request being 429'd since each time any of the rate-limiting methods are hit, a message with be logged in the Nginx error log.
35
35
36
-
To do so you first look up the request in the access logs, which can be done using the hypernode-parse-nginx-logs (**pnl**) command: `pnl --today --fields time,status,remote_addr,request --filter status=429`
36
+
To do so you first look up the request in the access logs, which can be done using the hypernode-parse-nginx-logs (**pnl**) command: `pnl --today --fields time,status,remote_addr,request,ua --filter status=429`
37
37
38
38
Copy the IP address from the output generated by this command and look up the corresponding log entry in the aforementioned Nginx error log with `cat /var/log/nginx/error.log | grep "1.2.3.4"`
0 commit comments