본문 바로가기
728x90
반응형

mysql3

[MariaDB / MySQL] 초기 셋팅 + 원격접속 계정 생성 apt-get install mysql apt-get install mariadb 1. 초기 보안설정 sudo mysql_secure_installation Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] Y ( 루트 패스워드 설정 여부 ) New password: Re-enter new password: Password updated s.. 2022. 1. 3.
Python 에서 MySQL 데이터 가져오기 import pymysql db = pymysql.connect(host='MySQL IP', user='MySQL ID', password='MySQL Password', db='DataBase Name', charset='utf8') curs = db.cursor() #Select Query sql = """select * from TableName""" curs.execute(sql) select = list(curs.fetchall()) db.commit() print(select)#튜플 형태로 반환받는다. #Insert Query sql = "insert into User (id, name) values(%s,%s)" curs.execute(sql,'MyID','MyName') db.commit.. 2020. 5. 4.
AMP 컴파일설치(MySQL) 1. 관련 패키지 설치 2. cmake 설치 (빌드 도구) 3. MySQL 계정 생성 VirtualBox 너무느려서 VMware로 다시 시작 4. 소스 다운로드 (https://dev.mysql.com/downloads/mysql/5.6.html) 5. 컴파일 && 설치 (못찍었음 ㅠㅠ) cmake \ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_DATADIR=/usr/local/mysql/data \ -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \ -DSYSCONFDIR=/usr/local/mysql \ -DMYSQL_TCP_PORT=3306 \ -DMYSQL_USER=mysql \ -DDEFAULT_CHARSET=utf.. 2019. 3. 31.
728x90
반응형