MariaDB installer on Linux changing the custom db file ownership to default mysql and causing database to go down - mariadb

When I run sudo apt upgrade, the MariaDB package installer will attempt to upgrade MariaDB but it'll change the database file ownership to default user 'mysql'. Since the file ownership got changed, MariaDB will fail to restart.
I've several servers configured with the same setup, but this problem is only seen in a few of them. I don't know how to configure the installer so that it does not change the file owner to default mysql.
Environment:
Linux Ubuntu 18 LTS
MariaDB 10.3
MariaDB setup:
Configured MariaDB to run as 'mydbuser' rather than the default 'mysql'.
Intalled dbfiles in /mydir/mariadb/.
File and dir ownership from /mydir/mariadb/ is set to mydbuser:mydbgroup.

Related

How do I create a database on MariaDB server?

My hosting provider shows Server version: 10.1.44-MariaDB-cll-lve - MariaDB Server on cPanel.
I'm about to do some dev work locally.
I installed MariaDB on my Windows 10. It went under C:\Program Files\MariaDB 10.4 and I see that it installed itself as a service called MariaDB. Service is running.
I'm asking my question after trying a whole whack of things because I had done this many times using MySQL before this MariaDB thing.
How do I create a database off an sql dump file?
Since nothing that I'm trying is working and this is a brand new Maria DB installation , I would rather not talk about how I did this before. Instead, having this MariaDB installation now, what do I do to import this sql file?
OK, so this is what we need to do:
Assuming that your database is called MyDB.
Start command prompt as admin.
cd C:\Program Files\MariaDB 10.4\bin> // /bin where your MariaDB installation went.
mysql -u root
create database MyDB;
exit;
mysql -uroot MyDB < C:/where-you-have-the-file/dump-file.sql
mysql -u root
use MyDB
show tables;
Hopefully, you see your schema.

Replicating Homestead Environment on Ubuntu 14.04.5

I am currently working on a laravel project on my MAC using homestead environment. Am i able to replicate a homestead environment on Ubuntu 14.04.5?
If you want to replicate the homestead environment you need to install this softwares as listed in the docs:
Git
PHP 7.1
Nginx
MySQL
MariaDB
Sqlite3
Postgres
Composer
Node (With Yarn, Bower, Grunt, and Gulp)
Redis
Memcached
Beanstalkd
Mailhog
ngrok
Probably you do not need all of them so remove what you do not use.
To install each software you can try so search in the apt repository and search for a guide con configure each of them.
For a LEMP stack you can try this: https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-in-ubuntu-16-04
Homestead uses a script called settler that it uses to provision the environment you use in Homestead, the script can be found here:
https://github.com/laravel/settler/blob/master/scripts/provision.sh

Difference in MariaDB installation packages on RHEL server?

On trying to install MySql on RHEL7 I came to know that we need to use MariaDB instead.
I tried the installation on my machine which is RHEL6 by adding MariaDB.repo file to /etc/yum.repos.d/ with following lines -
[mariadb]
name = MariaDB-5.5.39
baseurl=https://downloads.mariadb.com/files/MariaDB/mariadb-5.5.39/yum/rhel6-amd64/
# alternative: baseurl=http://archive.mariadb.org/mariadb-5.5.39/yum/rhel6-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
https://mariadb.com/kb/en/mariadb/yum/
Thereafter I installed it successfully using following command -
sudo yum install MariaDB-server MariaDB-client
Now on an RHEL7 production box same steps failed with following conflict -
file /etc/my.cnf from install of MariaDB-common-5.5.39-1.el6.x86_64 conflicts with file from package maria-libs-1:5.5.44-2.el7.x86_64
So I understand I am pointing to rhel6 repo on rhel7 and probably some pre-installed files are in conflict.
But when I execute below mysql/mariadb gets installed successfully, what difference does case make here?
sudo yum install mariadb mariadb-server
I am not sure if it is linked to a different repository in background, I dont have access to the instance to dig further in repo settings, can anyone help me out here?
You can clarify that using yum search mariaDB
I executed that an ended up with same result as mariaDB and mariadb
============================= N/S matched: mariaDB =============================
mariadb-bench.x86_64 : MariaDB benchmark scripts and data
mariadb-devel.i686 : Files for development of MariaDB/MySQL applications
mariadb-devel.x86_64 : Files for development of MariaDB/MySQL applications
mariadb-libs.i686 : The shared libraries required for MariaDB/MySQL clients
mariadb-libs.x86_64 : The shared libraries required for MariaDB/MySQL clients
mariadb-server.x86_64 : The MariaDB server and related files
mariadb.x86_64 : A community developed branch of MySQL
mariadb-test.x86_64 : The test suite distributed with MariaD
Name and summary matches only, use "search all" for everything.

Correct way to setup Virtualbox 4.3 to use symlinks on guest (for meteor)

I use Windows 8 and installed Virtualbox so i can access to a Linux (Ubuntu) System.
The most i still did to do this - so at this moment i have a working Virtualbox with Ubuntu 14.04 LTS.
In my case i need this Virtualbox with Linux for meteor.
The problem:
meteor uses nodejs and so i need to have symlinks access (i think its symlinks - i read a few about it)
Reference: How to run meteor app inside an Ubuntu VrtualBox and edit using an editor on a Windows host?
He describes the same problem i have now:
Error: EROFS, read-only file system '/media/sf_Shared/Dropbox/dev_uhurajr/chat/.meteor/local/.build320446.build/programs/server/npm/logging/main/node_modules'
So i tried to enabled Symlinks on my host (windows) this way:
VBoxManage setextradata YOURVMNAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOURSHAREFOLDERNAME 1
Reference: http://www.ahtik.com/blog/fixing-your-virtualbox-shared-folder-symlink-error/
This works fine! When i check the extradata for my VM the field SharedFoldersEnableSymlinksCreate is on 1
I set this value for 2 folders. The shared folder on Windows and also the name of the shared folder on my Linux VM.
But .. the same problem. The following error occurs everytime meteor tries to write symlinks:
Error: UNKNOWN, unknown error '/media/Projekte/test/.meteor/local/.build320446.build/programs/server/npm/logging/main/node_modules'
So whats the right way to get this working ?
Guessing you were using Virtualbox version after 4.0, please:
Enable symlinks VBoxManage.exe setextradata YOUR_VM VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOUR_SHARED_FOLDER 1
Run VirtualBox 'as admininstrator' on Windows.
Replace the YOUR_VM and YOUR_SHARED_FOLDER with your own value. You can check the value via VBoxManage.exe getextradata YOUR_VM enumerate
VirtualBox enabled symbolic for shared folder since 4.0, it's Windows permissions blocking you. You can either enable the permission for user or simply run VirtualBox as an administrator.
Please to refer the Virtualbox documentation:
Doc updated, please refer to the doc Shared Folders:
Starting with version 4.0, VirtualBox shared folders also support symbolic links (symlinks), under the following conditions:
The host operating system must support symlinks (i.e. a Mac, Linux or Solaris host is required).
Currently only Linux and Solaris Guest Additions support symlinks.
I made a development vm with setup and run scripts.
https://github.com/gfk-ba/meteor-dev-vm
Just put your meteor app in the app directory and follow the instructions in the readme.md

MariaDB on Windows - what is this error when trying to start the database engine?

I am asking this question as an offshoot myself and another SO had from this other MariaDB question:
MariaDB on Windows - getting started help?
When I install MariaDB (v5.2.4), open the command window, navigate to the folder where the files are installed, and type in the following to start the database:
net start mysql
I get the following error:
the service name is invalid
I didn't do anything complex, just ran the installation and tried to get started.
Any ideas?
The error basically tells that installer did not create the service (it currently does not create services), thus you'll need to do it yourself.
start elevated command line
switch to directory of your MariaDB installation (C:\Program Files\MariaDB 5.2.4, something like that)
bin\mysqld --install
and only then
net start mysql
Assuming that there is nothing that runs on port 3306, this will stat.
Alas, the server you will create this way would not be optimized at all.
It is better to create a configuration file my.ini (take a look at MySQL docs and .ini files in the installation directory for examples), and put with performance -related stuff here (innodb bufferpool size etc). With config file, you'll need a different command line to register service (step 3 above):
bin\mysqld --install MySQL --defaults-file=path\to\my.ini
Installer for 5.2.4 is basic indeed. It is being reworked though, new one is going to be better usable.
I installed MariaDB that comes with XAMPP on Windows 10. You will see only mysql in the XAMPP Control Panel. However, if you click Shell on the control panel you can access MariaDB monitor and MariaDB.
Here are some notes:
http://hodentekhelp.blogspot.com/2015/11/how-do-you-access-mariadb-in-xampp.html

Resources