So I tried it, and it works. Here's some notes.
mysql -u root -p mrbeardb —port=3306
References
- Linuxize - How to Connect to MySQL through SSH Tunnel
- https://linuxize.com/post/mysql-ssh-tunnel/
So I tried it, and it works. Here's some notes.
This is going to be a small blurb, on what I did to get this working.
Nothing out of the ordinary, really.And of course allow the user accounts to access mariadb remotely over the network.
Attention! I'm only doing this locally on a testing server! It's not a great idea to run mariadb connections remotely if you do not have to.
Just decided to do a followup on Adding MariaDB JDBC Connector to Payara 51.
I wanted to see if it was possibly very easy to do this using the command line.
The syntax:
Note the following:
Let's test it!
In case you wish to delete it, try:
Hello, again!
This is just a small blog post on how to backup and restore a MariaDB server, without using MysqlDump, but by directly copying the files in /var/lib/mysql.
First of course we need to shutdown mariadb.
Copying files:
When putting things back, things start to go wrong1.
Copying the files to a new host, causes this:
So, if the below code works, than SELinux is causing the issue:
Now you added mysql_t to permissive, as shown by the below printout:
Turning it back to enforcing, means running:
We need to relabel the new /var/lib/mysql directory:
Checking the current file contexts:
I need to check out MariaBackup2 3, as a better solution for creating backups compared to mysqldump.
I have always used the stock install of MariaDB that came with CentOS 7, but I noticed recently that it is still only on 5.5 (at the time of writing, 5.5.60).
I never had any issues with it, until I tried to upgrade my Liferay CMS system. Apparently there are definite changes that are not incorporated into the 5.5.
I wished to moved to 10.3, which is the latest stable branch, and I can apparently do that (as indicated on the mariadb website1) by creating a MariaDB repository for DNF and then installing as usual.
Of course, first uninstall the 5.5 version.
I am running MariaDB and I wish to execute sql scripts without all this hassle of entering my password. Of course this carries severe security risks with it, that we need to be aware of and, if possible, mitigate.
It is possible to execute sql scripts via the commandline1, but the problem here is that the password you use is visible in the process list. So this is a security risk.
Let's not do this.
I firstly checked out mysql_config_editor2, which enables you to put the password and other options into an encrypted configuration file. But it turns out that MariaDB does not come with that specific tool. The encryption used seems quite weak, and there's an article about the security issues at [3]. There is also the blogpost at [4] giving some details.
Well, there is always the plan to use the configuration file .my.cnf5, and you can store your mysql or mariadb password in there and everything would be hunky-dory.
The .my.cnf looks like this:
You are no doubt aware that the password is stored in cleartext.
The following security measures should be in place:
There is an example of a my.cnf containing every possible configuration option at /usr/share/mysql/my-large.cnf when you install MariaDB.