이 블로그 검색

레이블이 APM인 게시물을 표시합니다. 모든 게시물 표시
레이블이 APM인 게시물을 표시합니다. 모든 게시물 표시

2023년 4월 7일 금요일

MySQL on APM: Basic Usage and Configuration

 Starting MySQL Server

service mysql start

Creating a Database as a MySQL User

Username: root

Database name: test

mysqladmin -u root create test -p

It will ask for a password, but as there is no default password, simply press Enter.

Setting a Password for the Root Account

Account name: root

Password: 1234

use mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '1234'

Connecting to the MySQL Server as a User

Username: root

If successful, the prompt will change to mysql>:

mysql -u root -p

Listing Available Databases

show databases;

Selecting a Database to Use

use test;

Creating a Table

Table name: users

create table users (
        id varchar(10) primary key,
        name varchar(20) not null,
        password varchar(10) not null
        );

Listing Available Tables

show tables;

Describing a Table

Check the data type and constraints for each column.

DESC tables;

Retrieving Table Data

Table name: users

select * from users;

Inserting Data into a Table

Table name: users

insert into users (id,name,password) values (0, "name0", "pass0");

Importing a Database

Installing Git

apt-get install git

Cloning a Git Repository

Example database: https://github.com/datacharmer/test_db

git clone <https://github.com/datacharmer/test_db.git>
cd test_db

Importing SQL Files

mysql < employees.sql

Changing the MySQL Port

The default MySQL port is 3306. To change it, modify the port section in the mysqld.cnf file.

vim /etc/mysql/mysql.conf.d/mysqld.cnf

2023년 3월 30일 목요일

Understanding the Role and Interaction of APM: Apache, PHP, MySQL

ARM (Apache, PHP, MySQL)

Definition

To implement a web service, a web server, WAS, and a database are required, and a term used to refer to the combination of Apache, PHP, and MySQL, which were mainly used, is ARM (Apache, PHP, MySQL).

As of 2023, web servers and WAS are typically implemented together.

Web Server

  • A computer program that receives HTTP requests from clients such as web browsers and returns web pages such as HTML documents.

  • Handles Static web Pages

    Example of Web Servers

    Apache Server, Nginx, IIS (Windows-specific Web server), etc.

WAS (Web Application Server)

  • A computer program created to provide dynamic content that requires database queries or various logic processing.

  • Also known as "web containers" or "servlet containers."

  • Handles dynamic web pages

    Example of WAS

    Tomcat, JBoss, Jeus, Web Sphere, JSP, php, etc.

DB (Database)

  • A collection of data that is integrated and managed for the purpose of sharing and using it by multiple people.

  • Managed using DBMS (Database Management System)

    Example of DB

    MySQL, NoSQL, IDMS, MongoDB, etc.

Components of Web Services

Web Server: Apache

WAS: PHP

DB: MySQL

Apache

Definition

An HTTP server created by the Apache Foundation.

Advantages

  • Supports various functions
  • Easy to build a server
  • Free

Disadvantages

  • The server itself is somewhat heavy.
  • Vulnerable to Slow HTTP Header DoS (Slowloris) attacks.

PHP

Definition

A scripting language used to control web servers.

Features

  • Interpreter-based
  • Similar languages include ASP, JSP, etc.
  • Syntax is similar to C language.
  • Stateless

Advantages

  • Easy to integrate with databases
  • Supports file upload, email sending, etc. functions on its own
  • Code can be modularized by creating and inheriting classes.
  • Fast

Disadvantages

  • Inconsistency in the names of built-in functions and argument names
  • Inconsistency in error and exception handling

MySQL

Definition

One of the Database Management Systems (DBMS).

A set of tools that help to use databases.

Features

  • Composed of C and C++
  • Based on SQL

Advantages

  • Open source with GPL license = free
  • Easy to switch OS
  • Smaller and faster than other DBMSs
  • Large user community with access to a lot of information

Disadvantages

  • Transaction support is not perfect. For example, in some database systems, transaction processing can be interrupted due to network failures or server problems. In this case, some operations have already been completed, but the remaining operations have not been processed, which can compromise the consistency of the database (ensuring that stored data is accurate and valid). In such cases, recovery functions may be provided by the database system, or developers may need to write code to maintain consistency.

Logic Gate Truth Tables & Definitions

Logic Gate Truth Tables Java Code !A // NOT A&B // AND ~(A&B) // NAND A|B // OR ~(A|B) // XOR A^B // XOR ~(A^B) // XNOR ~A // Inve...