Tag Archives: fedora

MariaDB tips for Fedora 20

Installation

When I did installation of MySQL in Fedora 20, it automatically installed MariaDB database. In order to install MariaDB now, the current commands will be for example:

$ sudo su -
# yum install mariadb mariadb-server phpmyadmin
# sudo systemctl enable mariadb.service
# sudo systemctl start mariadb.service

In order to setup root password for MariaDB after installation you have to do the following:

$ mysql -u root
MariaDB [(none)]> set password for root@localhost = password('your_password');
MariaDB [(none)]> exit;

Now you can login into http://localhost/phpmyadmin as a user root using the defined password. In order to login into MariaDB console again, you have to change the command to request password authentication:

$ mysql -u root -p

Usage

The database has been installed, set up to start every time after reboot. What else can be done? In order to use it as a developer, we have to create also a new database inside. The simplest way is to login to phpmyadmin manager of MariaDB database. Select tab ‘Users’ and click on the button ‘Add user’. Fill in the user name, password, repeat the password and check option ‘Create database with same name and grant all privileges.’. That’s it! You’ll see the all SQL commands, which were executed. If you are able to type the commands into the console, you can use it as well, for example:

MariaDB [(none)]> create database jbpm;
MariaDB [(none)]> use jbpm;

For example now we can deploy and run any arbitrary application, which uses jbpm schema for persistence. The schema will be generated using DDL scripts automatically by hibernate. Later we can inspect the content of the database using other SQL commands.

Advertisements

My steps after Fedora installation

I’ve wanted to write a post about setting up my Linux environment for a long time. It’s for my personal purposes, so it doesn’t claim to be the best guide that you are looking for. The main motivation is to have easy-to-access place (like this blog), where I can find useful and well-arranged information quickly. I’ve googled many things many times and I would like to avoid repeating of my search queries. Code snippets are sometimes specific to Fedora 17, but generally the commands will be helpful with future releases too.

Do not count on Linux distribution upgrade feature

I’ve upgraded several Linux distributions many times in the past and rarely with success. Very often there have been problems with broken dependencies, kernel upgrades, hardware, Java, etc. The best solution is to divide your partition when doing the first installation (fortunately Fedora installer can partition the drive, if you are not sure):

  • root /
  • home dir /home
  • swap

This division of your hard drive partition enables you to just format your root partition and reinstall Linux there without any problems. All of your user data will be kept on your /home partition including configuration of all applications used before. This tip can save you several hours.

Install additional software

I am used to software of my choice and often I don’t like the default software for distribution chosen by someone else. So I install several types of packages:

$ su -
# yum -y install audacious audacious-plugins-freeworld-mp3 audacious-plugins-freeworld-ffaudio gimp git htop keepassx krb5-workstation nfs-utils pidgin subversion terminator thunderbird tig vim wireshark-gnome

Java

# yum -y install java-1.7.0-openjdk java-1.7.0-openjdk-devel

This command installs both Java runtime environment and development kit.

Services

# yum -y install httpd phpmyadmin mysql-server postgresql-server phpPgAdmin

Services include MySQL (mysqld) and PostgreSQL (postgresql) databases and web server (httpd). The services can be controlled like this:

# service httpd|mysqld|postgresql start|restart|stop

To start services at each system boot it is necessary to run:

# chkconfig postgresql on

Phpmyadmin might refuse to login. Then it’s necessary to reset MySQL database password:

$ mysql -u root
mysql> set password for root@localhost = password('yourpassword');
mysql> exit;

Later you need to login into MySQL using the password authentication.

$ mysql -u root -p

Unpackaged software

This kind of software includes many tools and application useful for Java developer.

  • Intellij Idea – instructions how to add GUI icon for Idea
  • Maven – just unzip and add $M2_HOME system variable and $M2_HOME/bin directory to your $PATH variable
  • Eclipse

Yes, the question is where to put these kind of software. You have probably successfully downloaded the archive into $HOME/Downloads. If your computer is and will remain single user, then the easiest solution is to put these applications inside something like ~/Apps. For multiuser machine you should use /opt, but this dir means additional configuration of access rights for root. After unzipping and moving the app directory you just need to add bin dir of the apps to your system $PATH variable.

Unofficial Fedora repository – RPM Fusion

Fedora strongly complies to the ideas of free software, so it doesn’t package nonfree software. But there are still many sites and data formats which require such nonfree software. To solve this problem you can add RPM Fusion repository, which contains such nonfree, but sometimes necessary software. You can follow their guide. Or just use these commands:

$ su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'
$ su -c 'yum install gstreamer-{ffmpeg,plugins-{good,ugly,bad{,-free,-nonfree}}}'

Install Adobe Flash

I have taken the steps from here.

# rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux
# yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl

Printer autodiscovery

This demonstrates how to configure cups to automatically discover all printers available in the local network.

# vim /etc/cups/cupsd.conf
Browsing On
BrowsePoll cups.site.company.com:631
# service cups restart

Sometimes it’s necessary to change user and group id, especially after system reinstallation (Fedora 20):

systemctl isolate multi-user.target
groupmod -g GID group
usermod -u UID -g GID user
systemctl isolate graphical.target
# find / -uid OLD_UID -exec chown -h UID  '{}' \+
# find / -gid OLD_GID -exec chgrp -h GID '{}' \+