Skip to content

Commit 31fb763

Browse files
authored
Update how-to-use-mysql-on-hypernode.md
1 parent d4f6ba5 commit 31fb763

File tree

1 file changed

+60
-50
lines changed

1 file changed

+60
-50
lines changed

docs/hypernode-platform/mysql/how-to-use-mysql-on-hypernode.md

Lines changed: 60 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ redirect_from:
1313

1414
# How to Use Mysql on Hypernode
1515

16-
This article explains how to use MySQL on Hypernode, from finding your credentials, whitelisting your IP address to using PHPMyAdmin.
16+
This article explains how to use MySQL on Hypernode, from finding your credentials, allowlisting your IP address, to using PHPMyAdmin.
1717

1818
## Finding Your Credentials
1919

@@ -35,41 +35,41 @@ host = mysqlmaster.example.hypernode.io
3535
## What You Should Know
3636

3737
- 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;
4141
- 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)).
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)).
4343

4444
## Whitelisting Your IP Address
4545

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.
46+
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.
4747

48-
### Whitelist via the hypernode-systemctl CLI Tool
48+
### Allow an IP via the hypernode-systemctl CLI tool
4949

5050
First check which IP addresses have been whitelisted already, if any.
5151

5252
```console
5353
hypernode-systemctl whitelist get
5454
```
5555

56-
### Adding to Whitelist
56+
### Adding to the Allowlist
5757

58-
To add more values to your whitelists you can run the following. Please note that descriptions are optional:
58+
To add more values to your allowlist you can run the following. Please note that descriptions are optional:
5959

6060
```console
61-
hypernode-systemctl whitelist add database 1.2.3.4 --description "my description"
61+
hypernode-systemctl whitelist add database 203.0.113.4 --description "my description"
6262
```
6363

64-
### Removing From Whitelist
64+
### Removing From the Allowlist
6565

66-
To remove values from your whitelists you can run the following:
66+
To remove IP addresses from your allowlists you can run the following:
6767

6868
```console
69-
hypernode-systemctl whitelist remove database 1.2.3.4
69+
hypernode-systemctl whitelist remove database 203.0.113.4
7070
```
7171

72-
### Whitelist via the Control Panel
72+
### Manage the Allowlist via the Control Panel
7373

7474
It's also possible to whitelist an IP address via the Control Panel
7575

@@ -98,16 +98,18 @@ Use your credentials to connect like so:
9898
mysql --host=mysqlmaster.example.hypernode.io --user=app --password=mypassword
9999
```
100100

101+
Please note you will need to add the remote host's IP address to the allowlist first, as described above.
102+
101103
### Using HeidiSQL/PHPMyAdmin to Connect to MySQL
102104

103105
Read the following articles on how to use both HeidiSQL and PHPMyAdmin for Hypernode:
104106

105-
- Using HeidiSQL
106-
- Using PHPMyAdmin
107+
- Using [HeidiSQL](../../best-practices/database/how-to-use-heidisql-on-hypernode.md
108+
- Using [PHPMyAdmin](../mysql/how-to-use-phpmyadmin.md)
107109

108110
### Using an SSH Tunnel to Circumvent Firewalls
109111

110-
If you are blocked by a firewall, you can tunnel the remote MySQL service to your local computer (Mac or Linux).
112+
If you are blocked by a firewall, you can create a temporary tunnel between the remote MySQL service and your local computer.
111113

112114
Use this command:
113115

@@ -154,15 +156,15 @@ You should consider using Magerun (see above), but you could use HeidiSQL to cre
154156

155157
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.
156158

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.
159+
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.
158160

159161
```console
160162
hypernode-systemctl settings mysql_version --value 5.7
161163
```
162164

163165
### How to Create a New Database
164166

165-
To create a new database, we’ll login using the MySQL client and drop the database using the command line.
167+
To create a new database, we’ll login using the MySQL client and create the database using the command line.
166168

167169
```bash
168170
DATABASE="new_database"
@@ -179,7 +181,7 @@ To prevent incorrect deletion of database that are still in use, ensure yourself
179181

180182
- The database is not used anymore by checking it’s content.
181183
- The database is not defined in your application configuration anymore.
182-
(IE: Check the `local.xml` and/or your `wp-config.php).`
184+
(IE: Check the `local.xml`, `env.php`, and/or your `wp-config.php).
183185
- You created a backup to ensure yourself you are able to restore the database if necessary.
184186

185187
When you are 100% sure it is safe to delete the database, issue the following command:
@@ -204,70 +206,64 @@ TABLE="core_url_rewrite"
204206
mysql "$DATABASE" -e "TRUNCATE TABLE $TABLE"
205207
```
206208

207-
### Changing Your MySQL 5.6 Password
209+
## Changing Your Password
210+
211+
How you change the database password depends on what version of MySQL you are running on your Hypernode.
212+
213+
### Changing Your Password on MySQL 5.6
208214

209215
Login to your MySQL server via the following command:
210216

211217
```console
212218
mysql
213219
```
214220

215-
This will get you into the MySQL prompt. Now change the password for a given user account using this command:
221+
This will get you into the MySQL prompt. In this example we change the password for the `app` user to `p4ssw0rd`
216222

217223
```mysql
218-
update user set password=PASSWORD('newpassword') where user='username';
224+
SET PASSWORD FOR 'app'@'%' = PASSWORD("p4ssw0rd");
219225
```
220226

221-
Let’s assume here that your username is ‘trial’ and your new password is ‘hypernode’. Your actual command would look like this:
227+
Your password has been updated. There’s no need to restart the MySQL demon. Exit the MySQL with
222228

223229
```mysql
224-
update user set password=PASSWORD('hypernode') where user='trial';
230+
exit;
225231
```
226232

227-
Now your password is changed in the database, but they haven’t filtered into memory yet. Change that by typing:
233+
### Changing Your Password on MySQL 5.7
228234

229-
```mysql
230-
flush privileges;
235+
Login to your MySQL server via the following command
236+
237+
```console
238+
mysql
231239
```
232240

233-
Your password has been updated. There’s no need to restart the MySQL demon. Exit the MySQL with
241+
This will get you into the MySQL prompt. In this example we change the password for the `app` user to `p4ssw0rd`
234242

235243
```mysql
236-
exit;
244+
ALTER USER `app` IDENTIFIED BY 'p4ssw0rd';
237245
```
238246

239-
## How to Upgrade Your MySQL Version
240-
241-
### Upgrading to MySQL 5.7
242-
243-
**Please note that once you have upgraded the MySQL version on your Hypernode, you won't be able to downgrade it.**
244-
245-
You can upgrade the MySQL version on your Hypernode from 5.6 to 5.7 with the following command:
247+
Your password has been updated. There’s no need to restart the MySQL demon. Exit the MySQL with
246248

247-
```bash
248-
hypernode-systemctl settings mysql_version 5.7
249+
```mysql
250+
exit;
249251
```
250252

251-
You can then check with `livelog` when the process has finished and your MySQL version has been upgraded.
253+
Remember to update your `~/.my.cnf` with your new password so you could easily login your MySQL-CLI without entering the password each time.
252254

253-
### Changing Your MySQL 5.7 Password
255+
### Changing Your Password on MySQL 8.0
254256

255257
Login to your MySQL server via the following command
256258

257259
```console
258260
mysql
259261
```
260262

261-
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:
263+
This will get you into the MySQL prompt. In this example we change the password for the `app` user to `p4ssw0rd`
262264

263265
```mysql
264-
update user set authentication_string=password('newpassword') where user='app';
265-
```
266-
267-
Now your password is changed in the database, but they haven’t filtered into memory yet. Change that by typing:
268-
269-
```mysql
270-
flush privileges;
266+
ALTER USER `app` IDENTIFIED BY 'p4ssw0rd';
271267
```
272268

273269
Your password has been updated. There’s no need to restart the MySQL demon. Exit the MySQL with
@@ -278,11 +274,25 @@ exit;
278274

279275
Remember to update your `~/.my.cnf` with your new password so you could easily login your MySQL-CLI without entering the password each time.
280276

277+
## How to Upgrade Your MySQL Version
278+
279+
### Upgrading to MySQL 5.7
280+
281+
**Please note that once you have upgraded the MySQL version on your Hypernode, you won't be able to downgrade it.**
282+
283+
You can upgrade the MySQL version on your Hypernode from 5.6 to 5.7 with the following command:
284+
285+
```console
286+
hypernode-systemctl settings mysql_version 5.7
287+
```
288+
289+
You can then check with `livelog` when the process has finished and your MySQL version has been upgraded.
290+
281291
### Upgrading to MySQL 8.0
282292

283293
**Please note that once you have upgraded the MySQL version on your Hypernode, you won't be able to downgrade it.**
284294

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 You can upgrade the MySQL version on your Hypernode from 5.7 to 8.0 with the following command:
295+
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:
286296

287297
```console
288298
hypernode-systemctl settings mysql_version 8.0

0 commit comments

Comments
 (0)