본문 바로가기

mysql

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 에 삽입하는 코드이다. 이 단순한 몇을을 찾기 위해 얼마나 헤매였단가~ 먼산 .. 더보기
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.. 더보기
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.. 더보기