본문 바로가기

MariaDB

주식 정보 데이터베이스(db) 구축하기 by using python | storing stock data into database(DB) by using python 몇 년 전부터 db에 저장된 데이터를 이용해서 종목 발굴 알고리즘을 돌려놓고 있으며, 이를 이용해 특이점이 발견된 종목은 바로바로 문자 or email 등을 통해서 알려주고 관련 데이터를 저장하게 하는 시스템을 구축해 놓은 상황이다. 관련해서 문의 글이나 메일 혹은 문자를 통해 방법을 문의하는 글이 있어 개략적이나마 기본 개념을 작성해 두려고 한다. 우선 파이썬을 이용해서 주식 데이터를 데이터베이스(db)에 저장하는 작업을 하려고 한다. 이를 위해 기본 개념 몇몇을 알고 있어야 하지만, 관심이 있으신 분들은 관련 정보를 공부해 보시길 바란다. 가장 먼저 파이썬이라는 프로그램의 기본 개념을 익혀야 할 것이다. 그런 다음 관련 모듈을 설치, 기본 문법등을 차근차근 학습하면 될 것이다. 아래 코드는 완전한 코.. 더보기
how to insert dataframe data into mysql database using pymysql(pure python3 library) import pandas as pdimport mysql.connector from sqlalchemy import create_engine python을 이용해서 만든 데이터를 데이터베이스(DB)에 저장을 하기위한 모듈들이다. python3 에서는 Python에서 잘 작동하던 mysqldb 가 작동하지 않는다. 그래서 예전에 만들어둔 코드들이 더 이상 작동을 하지 않아 한 동안 애를 먹었던적이 있었다. 이번 기회에 이전 데이터를 python3를 이용해서 다시금 DB에 저장해두고 활용을 해 보고자 관련글을 작성해 둔다. 아래는 python3에서 pandas dataframe 으로 만들어진 데이터를 mysql or mariadb 에 삽입하는 코드이다. 이 단순한 몇을을 찾기 위해 얼마나 헤매였단가~ 먼산 .. 더보기
install mariadb on ubuntu | mariadb 설치하기 on ubuntu Installing MariaDB using APTFor Debian and Ubuntu, it is highly recommended to install from the repositories, using apt-get, aptitude, synaptic or another package manager.The easiest way to get things set up is to use our online repository configuration tool and follow the instructions it generates.Import the GnuPG signing keyFirst import the GPG key we use to sign the repositories. This step on.. 더보기
List of SQL Commands BACKGROUNDSQL, 'Structured Query Language', is a programming language designed to manage data stored in relational databases. SQL operates through simple, declarative statements. This keeps data accurate and secure, and helps maintain the integrity of databases, regardless of size.Here's an appendix of commonly used commands.COMMANDSALTER TABLEALTER TABLE table_name ADD column datatype; ALTER TA.. 더보기
How to install mariadb on ubuntu | 우분투에 마리아디비 설치하기 Install MariaDB on Ubuntu 16.04Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.12apt-get updateapt-get upgrade Step 2. Installing MariaDB. Installing MariaDB is as simple as running just one command below:1apt-get install mariadb-serverIf you want to install MariaDB 10.x Which is not included in distribution reposit.. 더보기
Mariadb Sovle : Plugin 'unix_socket' is not loaded The "unix_socket" has been called by mysql authentication process (maybe related to a partial migration of database to mariadb, now removed). To get all stuff back working go su:sudo su then follow:/etc/init.d/mysql stop mysqld_safe --skip-grant-tables & mysql -uroot This will completely stop mysql, bypass user authentication (no password needed) and connect to mysql with user "root".Now, in mys.. 더보기