mysql(2)
-
리눅스 MariaDB 외부접속 가능하게 설정하기
리눅스는 Debian 리눅스를 기준으로 합니다. /etc/mysql/my.cnf 파일수정 bind-address = 0.0.0.0 위 bind-address = 0.0.0.0 을 추가해줍시다. 사용자 작성, 권한 부여 # mysql -u root -p MariaDB [(none)]> create database etssun_db; // 데이터베이스 생성 MariaDB [(none)]> create user 'etssun'@'%' identified by 'root'; // etssun 이라는 계정을 비밀번호를 root로 생성 MariaDB [(none)]> grant all privileges on etssun_db.* to etssun@'%'; //etssun_db 라는 데이터베이스의 권한을 etssu..
2018.07.30 -
JDBC - MariaDB 와 Java 연동 메소드 예제
JDBC 커넥터는 https://downloads.mariadb.org/connector-java/위 링크에서 다운로드 가능합니다. 다운로드 받은 커넥터는 라이브러리에 추가해준뒤 데이터베이스 커넥션 소스에서 드라이버를 임포트 해줍니다. import org.mariadb.jdbc.Driver; connectToDB 라는 예제 메소드를 작성해보았습니다. private static Connection connectToDB() { try { Class.forName("org.mariadb.jdbc.Driver"); } catch (ClassNotFoundException e) { e.printStackTrace(); } try { String jdbcUrl="jdbc:mariadb://localhost:3306..
2018.07.30