Hetzner - DokuWiki

KonsoleH:MySQL/en

Inhaltsverzeichnis

Database: MySQL

What is MySQL?

MySQL is an Open Source RDMS (Relational Database Management System) that uses SQL (Structured Query Language) to process information. It is a widely- used application for websites which accesses databases.

Creating a MySQL database

On the main page of the MySQL database manager you will see your list of databases, in which all databases can be viewed which currently exist.

How to create a new MySQL database:

  1. Click on "Add".
  2. On the following page you will see the recommended (random) access details for your database. If you wish you can provide your own password here.
  3. Select a name for the database as well as a name for the corresponding database user.
  4. The main password is the most important. It provides access to the whole database and allows you to create, change or delete any database information, column or row.
  5. The R/W (Read/Write) password only gives you read/write access. This is mostly used by CMS (Content Management Systems) to add or change database information.
  6. The R/O (Read Only) password allows the application to read information from the database only. Information cannot be altered with this password.
  7. (Optional) Require SSL prohibits all unencrypted connections to the database. This can have a negative effect on the accessibility of the database
  8. Click on "Save" to create the database.
  9. A success message will appear. Click on "MySQL-Databases" to return to your database list.

Tip: If you receive an error message when creating the database, try to vary the database name and/or username.

Manage your Database(s).

In the overview you have the possibility to create a new database or to modify, delete, backup and access existing databases via phpMyAdmin.

If you wish to delete a database, konsoleH will require confirmation before finally deleting it. Be careful when you confirm the instruction, as this cannot be reversed.

Access your database via SSL

You can access your database in an encrypted manner using SSL. We can provide you with a ready-made certificate that you can use to carry out the encryption. Note: The speed of encrypted connections is slower.

The certificate is:

-----BEGIN CERTIFICATE-----
MIIG7jCCBNagAwIBAgIJAOHaB6/9NNBGMA0GCSqGSIb3DQEBBQUAMIGqMQswCQYD
VQQGEwJERTEPMA0GA1UECBMGQmF5ZXJuMRUwEwYDVQQHEwxHdW56ZW5oYXVzZW4x
GjAYBgNVBAoTEUhldHpuZXIgT25saW5lIEFHMRIwEAYDVQQLEwlEYXRhYmFzZXMx
GzAZBgNVBAMTEnNxbC55b3VyLXNlcnZlci5kZTEmMCQGCSqGSIb3DQEJARYXcm9v
dEBzcWwueW91ci1zZXJ2ZXIuZGUwHhcNMTMxMjEwMTMwOTAzWhcNMjMxMjA4MTMw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v2YGYmSMkAi5+0iiRSRaKGBsKSBrTCBqjELMAkG
A1UEBhMCREUxDzANBgNVBAgTBkJheWVybjEVMBMGA1UEBxMMR3VuemVuaGF1c2Vu
MRowGAYDVQQKExFIZXR6bmVyIE9ubGluZSBBRzESMBAGA1UECxMJRGF0YWJhc2Vz
MRswGQYDVQQDExJzcWwueW91ci1zZXJ2ZXIuZGUxJjAkBgkqhkiG9w0BCQEWF3Jv
b3RAc3FsLnlvdXItc2VydmVyLmRlggkA4doHr/000EYwDAYDVR0TBAUwAwEB/zAN
BgkqhkiG9w0BAQUFAAOCAgEAkXyr2ndDBJ+XN7Vy5K9Xc198eqkE2xXPGgsCy9EK
r3bskuC1cAdFWyR/0ZXRUp3yXAMj6azaKtZ5T/ZRyrgsjviLDA52lYeuE7owYmAZ
iA9MNCP9yn/OvfLMG7JQBDbxiZ5JWRnAMbCwWnijGYGiA8sv0i2VmC/nA2d6l7vu
h/30CQfQG/MjPLloAsyyqbSmUqSyjegUAdHXeZhALRuUPQ9Xlp+CU6vqCd/NjTEc
HPFA/rYoL2XKMg+CUX+CGlZiiSOGhELFklaq5SJrjJHATP5cUBYXeHsLZs8fem48
JncyB82AuWdk7jBTKrKE39Nf9hiV+KOLN+smLKVKZ1zOzyLE4x2Yfy7l2MLbDItU
VzdOOTAmxcqBm+iTRwbKO0CaDGsaeUGLMGXSSncSYyXxaXC+Yju2eyk2r9BMNkfB
C+/bzx1MyozSz524JRRkd7TOmCFmWjH+xpWJsBElzdmt3B0d3svcpnZ8XlBuWB2S
V1ZO6Ryr23GeLyio2njVz54xCXUabJ6vt5lyN95Aw2BL8DNxny3lZtl9HqsDW/SK
wpKVWuJoYWnhX1a+SEtYmADX03j0yVXTLI7cnIBcQLINufrIRV4OITP4xbe0CPLO
YL3qKbYlvZjLJBISw1L3ne9xlewzllfPkRwLQPImdhO9wSoe8BWqtpuz13gAXZPG
0Ac=
-----END CERTIFICATE-----

You can save the certificate locally as a text file (for example, as "sqlca.pem"). Once you have done that, you can make an encrypted connection. Unfortunately, however, it is not possible for you to use your own client certificates.

Example commands for encrypted access to MySQL:

  • MySQL command line
    • mysql --ssl --ssl-ca sqlca.pem -h HOSTNAME ...
  • PHP (PDO)
    • $pdo = new PDO('mysql:host=HOSTNAME;dbname=DBNAME', 'BENUTZER', 'KENNWORT', array( PDO::MYSQL_ATTR_SSL_CA=>'sqlca.pem'));
  • PHP (mysqli)
    • $db = mysqli_init();
      $db->ssl_set(NULL, NULL, 'sqlca.pem', NULL, NULL);
      $link = mysqli_real_connect ($db, 'HOSTNAME', 'BENUTZER', 'KENNWORT','DBNAME', 3306, NULL, MYSQLI_CLIENT_SSL);
  • JAVA
    • For Java, first import the certificate into the keystore. Then you can establish the connection with:
    • jdbc:mysql://[host][:port]/[database]?useSSL=true&requireSSL=true&trustCertificateKeyStorePassword=<secret>&trustCertificateKeyStoreUrl=file:/path/to/my/keystore

What is phpMyAdmin?

phpMyAdmin is a graphic database administrations tool for MySQL. It is a good way to manage the database(s) without learning the SQL language.

Over the graphic interface you can add, edit and delete information easily.

For more information about phpMyAdmin, please visit the official website <a href="http://www.phpmyadmin.net/">http://www.phpmyadmin.net/</a> .

For larger databases, we recommend using a query browser. Examples of free query browsers: <a href="https://www.mysql.com/de/products/workbench/">https://www.mysql.com/de/products/workbench/</a>, <a href="https://www.heidisql.com/">https://www.heidisql.com/</a>



© 2020. Hetzner Online GmbH. Alle Rechte vorbehalten.