Skip to main content

MySQL, MariaDB

Wordpress: Sessions löschen

FROM `wp_options`
WHERE option_name LIKE '_wp_session%'

Datenbank kopieren

mysql> CREATE DATABASE testdb_copy;  

mysqldump -u root -p testdb > D:\Database_backup\testdb.sql  

mysql -u root -p testdb_copy < D:\Database_backup\testdb.sql  

mysql> SHOW TABLES;  

Zugriff von außen


You can do it by editing the MariaDB default configuration file. Look for "bind-address" directive in these two locations (make the change in whichever file you find that directive). You can open the file using your favorite text editor:

$ nano /etc/mysql/my.cnf


$ sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

Change the value of the bind-address from to so that MariaDB server accepts connections on all host IPv4 interfaces.

bind-address =

Save and close the file when you are finished. Then, restart the MariaDB service to apply the changes:

$ sudo systemctl restart mariadb

Grant Access to a User from a Remote System

In this section, we will create a new database named wpdb and a user named wpuser, and grant access to the remote system to connect to the database wpdb as user wpuser.

First, log in to the MariaDB shell with the following command:

$ mysql -u admin -p

Provide your admin (root) password as shown in the Webdock backend and when you get the prompt create a database and user with the following command:

MariaDB [(none)]> CREATE DATABASE wpdb;
MariaDB [(none)]> CREATE USER  'wpuser'@'localhost' IDENTIFIED BY 'password';

Next, you will need to grant permissions to the remote system with IP address to connect to the database named wpdb as user wpuser. You can do it with the following command:

MariaDB [(none)]> GRANT ALL ON wpdb.* to 'wpuser'@'' IDENTIFIED BY 'password' WITH GRANT OPTION;

Next, flush the privileges and exit from the MariaDB shell with the following command:

MariaDB [(none)]> EXIT;
grant all on *.* to 'username'@'%' identified by 'password' with grant option;