Manage MySQL Database

Gewijzigd op Di, 6 Jan om 10:22 AM

Manage MySQL Database

Login Details

The MySQL login details are found in the .my.cnf file located at the home directory of the hosting account. This can be viewed using either SSH or SFTP.

For non-clustered environments, it is optimal to use localhost as the hostname for connecting to MySQL. The connection will be made through a local unix socket. This works best for applications on the same server. When you need a TCP connection such when an SSH tunnel is used, 127.0.0.1 should be used as the hostname for MySQL.


PhpMyAdmin

Savvii has PhpMyAdmin available at every server. You will need to know the name of your shop's server and the URL for PhpMyAdmin is:

https://<server.domain.tld>/mh_phpmyadmin

You can use the same login details as Magento uses to access the database. The database user will be the same as the SSH/SFTP user of the hosting account. If you try a wrong password too often, your IP will be blocked from accessing. To unblock yourself, contact us.


Create Extra Database

You can create extra databases if you start the name with your username followed by an underscore, for example myuser_extradb. You can do this using SSH:

mysql  '' -e 'CREATE DATABASE myuser_extradb;'


Remove a Database

Warning: Potential data loss
You can remove a database by using SSH:

mysql  '' -e 'DROP DATABASE myuser_dbname;'


Direct connection to 3306

A direct connection from your desktop or another server to the MySQL database is only possible when you use an SSH tunnel. The tunnel is required to protect your passwords and transferred data.


Step 1: Create the SSH Tunnel

In this example, we are using port 3307 on your local machine to connect to host 127.0.0.1 port 3306 on the Savvii server side. You need to keep the SSH connection open.

ssh -p2222 -L3307:127.0.0.1:3306 <user>@<server>

Step 2: Connect to MySQL

In another window on your computer where you started the SSH tunnel, connect to port 3307 on localhost with:

mysql -h127.0.0.1 -P3307 -p -u<user>

You can also use an application to connect to port 3307 on host localhost, on the same computer where you started the SSH connection.

Was dit artikel nuttig?

Dat is fantastisch!

Hartelijk dank voor uw beoordeling

Sorry dat we u niet konden helpen

Hartelijk dank voor uw beoordeling

Laat ons weten hoe we dit artikel kunnen verbeteren!

Selecteer tenminste een van de redenen
CAPTCHA-verificatie is vereist.

Feedback verzonden

We stellen uw moeite op prijs en zullen proberen het artikel te verbeteren