Wednesday, March 18, 2020

Install Mysql server on ubuntu 18.04.4 LTS

MySQL is one of the most popular open-source relational database management systems. It’s widely used in web applications, enterprise software, and data-driven projects.

This will show you how to install MySQL Server on Ubuntu 18.04.4 LTS, set the root password, and verify the installation.

Step 1: Update Package Index

Open a terminal and update your system’s package index:

sudo apt update

Step 2: Install MySQL Server

Install MySQL Server package:

sudo apt install mysql-server


The installation will automatically start the MySQL service.

No password is required during installation as the default authentication plugin is auth_socket.

Step 3: Verify MySQL Installation

Exit the current terminal and open a new terminal, then try logging in:

mysql


You may get the error:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)


This happens because MySQL on Ubuntu 18.04 uses auth_socket by default, which requires the root user to log in via the system user account.

Step 4: Log in as Root

Use sudo to access MySQL as root:

sudo mysql

Step 5: Set Root Password

Once inside the MySQL shell, run the following command to set a root password and switch to the mysql_native_password plugin:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password';


Replace 'your_password' with a strong password of your choice.

Step 6: Apply Changes

Flush privileges so the changes take effect:

FLUSH PRIVILEGES;

Step 7: Verify MySQL Access

Now, you can log out of MySQL and log in again using the root password:

mysql -u root -p


Enter your password when prompted. Then verify your databases:

SHOW DATABASES;


You should see the default MySQL databases like mysql, information_schema, performance_schema, etc.

Tuesday, February 25, 2020

Install Oracle Java 11 on Ubuntu 18.04.4 LTS

Oracle Java 11 is a Long-Term Support (LTS) version widely used for enterprise applications, web servers, and development environments. Unlike OpenJDK, Oracle Java comes with commercial support and additional features.

This guide will show you step-by-step how to install Oracle Java 11 on Ubuntu 18.04.4 LTS.


Open the terminal and type these command in the terminal.

Step 1: Create a Local Installer Directory

Oracle Java installer requires a local cache directory. Run:

sudo mkdir -p /var/cache/oracle-jdk11-installer-local/


This creates a folder where the installer will look for the downloaded .tar.gz file.

Step 2: Move the Downloaded JDK File

Navigate to the folder where you downloaded the Oracle JDK 11 .tar.gz file:

cd ~/Downloads


Then copy the file to the local installer directory:

sudo cp jdk-11.0.6_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/

Step 3: Remove Previous Oracle Java 11 (Optional)

If you have a previously installed Oracle Java 11, remove it first:

sudo apt purge oracle-java11-installer


This ensures a clean installation.

Step 4: Add the Linux Uprising PPA

Add the Linux Uprising PPA to get the Oracle Java installer:

sudo add-apt-repository ppa:linuxuprising/java
sudo apt-get update

Step 5: Install Oracle Java 11

Install the local Oracle Java 11 installer:

sudo apt install oracle-java11-installer-local

Step 6: Set Oracle Java 11 as Default

To set Java 11 as the default version for your system, run:

sudo apt install oracle-java11-set-default-local