A guide to install MariaDB and connect it to DBeaver on Linux Manjaro.
After struggling myself on this topic I decided to create this guide which gathers various resources found on the web, and share it in the name of helping my future self - and possibly others - who might be facing the same issues.
As already mentioned, I put this guide together by gathering various resources mentioned at the bottom of this document.
You're very encouraged to report any incorrectness you may find.
This guide comes with absolutely no warranty.
I decided to go with DBeaver as it proved to be stable on my machine. MySQL Workbench on the other hand would crash 9 times out of 10, so I decided to save myself some time and go with the former.
Open a new terminal and install MySQL via pacman
sudo pacman -S mysql
You are prompted with two options. Choose mariadb
repository extra as mysql provider by pressing Enter or manually entering 1
.
You can now start MariaDB
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
And execute mysql_secure_installation shell script
sudo mysql_secure_installation
See following screenshot as reference to determine which actions to perform - or see the original documentation here
In the original documentation comments section, some users warn about a missing step:
You already have your root account protected, so you can safely answer 'n'.
Switch to unix_socket authentication [Y/n] n
... skipping.
When you're done, get inside MariaDB service
sudo mariadb
Or alternatively
mysql -u root -p
You can run all the commands you want here
create database <dbtest_name>;
show databases;
It's now necessary to grant user permissions
GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY '<your_password>' WITH GRANT OPTION;
And apply the changes
FLUSH PRIVILEGES;
Download DBeaver via Add/Remove Software and open it.\
Click Database > New Database Connection > Select MariaDB and hit Next
Hit the Finish button and you're set!
You should now see your DB named localhost inside Database Navigator tab
https://www.youtube.com/watch?v=fwGJukksL9w
https://www.youtube.com/watch?v=DtRXOoQwdxY&t=444s
https://mariadb.com/kb/en/mysql_secure_installation/
https://stackoverflow.com/questions/50453078/unable-to-connect-to-mariadb-using-dbeaver