SSH Access Denied because Invalid User

This is an article which is made to show an alternative for describing on how to solve problems where there is an error generated by SSH utility command which is executed to remote several servers. The error is ‘access denied’ as shown below :

user@hostname:/opt$ ssh - l remoteuser@xxx.xxx.xxx.xxx
Access denied
user@hostname:/opt$  

In order to solve the problem, there are several steps which is taken as described below :

1. Check to content of /var/log/secure

Continue reading

MySQL Database generate ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails

This is another article written in order to handle error which is generated from MySQL Database Server. The error as specified in the title is ‘Cannot add or update a child row: a foreign key constraint fails’. The error itself is triggered when a query is being executed. In the context of this article, the query which is being executed is performed to add a record in the table.

The scenario is actually similar or in other words it is the scenario which is used in other article titled ‘MySQL Database generate ERROR 1215 (HY000): Cannot add foreign key constraint‘ which can be visited in this link.

The relationship between tables can be viewed in the following image :

MySQL Database generate ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails

MySQL Database generate ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails

Basically, the scenario is following the above ERD (Entity Relationship Diagram) with the availability of three tables. The error triggered when a query which is performed to insert a new record is being executed in table user_role. Below is the example of the query executed through MySQL Command Console :

Continue reading

Installing DIA on Ubuntu16.04

DIA which is stands for Diagram Editor is a multi-purpose editor developed for editing numerous diagram such as ERD (Entity Relationship Diagram), UML or any other diagrams that can be saved and exported to other formats. Moreover, this editor is available in several operating system to be installed.

In this article, there will be steps explained to install DIA in Ubuntu 16.04 Linux Operating System. Below are those steps :

  1. First of all, the most general step is to update the operating system. The following syntax is the one which is used to perform it :
apt-get update

Below is the execution of the above command in a command prompt :

Continue reading

MySQL Database generate ERROR 1215 (HY000): Cannot add foreign key constraint

This is an article where the writing is made to explain and to describe a way or an alternative to handle the error generated from the execution of a query in MySQL Database. After executing a query in a SQL console which is solely to add a foreign key, the error which is shown in the title specifically stated ‘Cannot add foreign key constraint’.

The error is made in an attempt to add a foreign key which is intended for a third table in a many-to-many relationship. As we already knew, a way to handle a many-to-many relationship between two entities can be solved by creating another table which is the third one to save the identifier from each table.

Supposed if there is a table named ‘user’ and also another table named ‘role’ where a user can have many roles and a roles can be owned or possessed by many user. That condition is actually a many-to-many relationship between those two entities.

Continue reading

Create Additional Table for Many to Many Relationship in MySQL Database Server

This is an article which is made to display some sort of explanation on creating an additional table for many to many relationship. As it has already known that creating additional table is necessary to describe a many to many relationship.

The scenario is described in detail as follows :

If there are many users whom are registered to a system where those users are also have lots or more than one roles in the system. Below is actually the scenario for creating the tables. In this context, the database which is used is MySQL. First of all, create the user table :

CREATE TABLE user
(  
    id INT NOT NULL AUTO_INCREMENT,
    PRIMARY KEY(id),   
    Title VARCHAR(255)
)

And after that, create the other table which is made to manage the roles available. It is shown as follows :

Continue reading