관리 메뉴

B_V (PW: 0987)

ㄹ.Vue & Spring Boot: 일정 본문

Tesk/vue.js

ㄹ.Vue & Spring Boot: 일정

Eve B_V 2021. 8. 13. 10:49

1.Spring Boot + Vue CLI 3.0 프로젝트 구성하기
https://mr-spock.tistory.com/3?category=794235

Q: Vue프로젝트를  build한 파일들이 static폴더에 저장되는 이유?
참고 https://spring.io/blog/2013/12/19/serving-static-web-content-with-spring-boot

A: CLI 통해 build할 경우 vue프로젝트의 소스들이 정적 리소스로 static폴더에 생성 > Spring Boot에서 static폴더에 있는 정적 리소스 자동 추가하면서 localhost:8080/의 경우 정적리소스의 root인 static폴더참고하게된다.

2.DB 설치  접속 테스트
https://ayoteralab.tistory.com/entry/Spring-Boot-02-DB%EC%84%A4%EC%B9%98-%EB%B0%8F-Connection?category=860804

> 다운로드 받기 https://devuryu.tistory.com/41

 

[Mac] 마리아DB!! mariaDB - 세팅하기(초보는 힘드렁)

[Mac] MariaDB 설정 서투르지만 하나씩 배우는 mariaDB 설정하기 드디어 Mac에 MariaDB 를 설정해야 하는 날이 왔습니다. mariaDB를 설정하는데 설치 방법을 찾는데 헤맸으며, 더구나 설치하고 실행순서에

devuryu.tistory.com

https://bongjacy.tistory.com/entry/Mac%EC%97%90-MariaDB-%EC%84%A4%EC%B9%98%ED%95%98%EA%B8%B0

 

Mac에 MariaDB 설치하기

안녕하세요 봉자씨입니다 맥에 MariaDB를 설치 해보도록 하겠습니다. 전체 과정은 아래와 같이 이루어 집니다. 1. 맥북 커맨드라인 툴인 x-code 설치 2. 루비를 이용해 Homebrew를 설치 3. Homebrew를 이용

bongjacy.tistory.com

> 새로 열어서 바로 mysql .server start 한후 mysql -u root -p한후 비번치면 아래처럼 실행됨~!

Last login: Fri Aug 13 14:59:37 on ttys008
shy@EveningBreadui-MacBookPro ~ % mysql .server start
mysql  Ver 15.1 Distrib 10.6.4-MariaDB, for osx10.16 (x86_64) using readline 5.1
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Usage: mysql [OPTIONS] [database]

Default options are read from the following files in the given order:
/usr/local/etc/my.cnf ~/.my.cnf 
The following groups are read: mysql mariadb-client client client-server client-mariadb
The following options may be given as the first argument:
--print-defaults          Print the program argument list and exit.
--no-defaults             Don't read default options from any option file.
The following specify which files/extra groups are read (specified before remaining options):
--defaults-file=#         Only read default options from the given file #.
--defaults-extra-file=#   Read this file after the global files are read.
--defaults-group-suffix=# Additionally read default groups with # appended as a suffix.

  -?, --help          Display this help and exit.
  -I, --help          Synonym for -?
  --abort-source-on-error 
                      Abort 'source filename' operations in case of errors
  --auto-rehash       Enable automatic rehashing. One doesn't need to use
                      'rehash' to get table and field completion, but startup
                      and reconnecting may take a longer time. Disable with
                      --disable-auto-rehash.
                      (Defaults to on; use --skip-auto-rehash to disable.)
  -A, --no-auto-rehash 
                      No automatic rehashing. One has to use 'rehash' to get
                      table and field completion. This gives a quicker start of
                      mysql and disables rehashing on reconnect.
  --auto-vertical-output 
                      Automatically switch to vertical output mode if the
                      result is wider than the terminal width.
  -B, --batch         Don't use history file. Disable interactive behavior.
                      (Enables --silent.)
  --binary-as-hex     Print binary data as hex
  --character-sets-dir=name 
                      Directory for character set files.
  --column-type-info  Display column type information.
  -c, --comments      Preserve comments. Send comments to the server. The
                      default is --skip-comments (discard comments), enable
                      with --comments.
  -C, --compress      Use compression in server/client protocol.
  -#, --debug[=#]     This is a non-debug version. Catch this and exit.
  --debug-check       Check memory and open file usage at exit.
  -T, --debug-info    Print some debug info at exit.
  -D, --database=name Database to use.
  --default-character-set=name 
                      Set the default character set.
  --delimiter=name    Delimiter to be used.
  -e, --execute=name  Execute command and quit. (Disables --force and history
                      file.)
  -E, --vertical      Print the output of a query (rows) vertically.
  -f, --force         Continue even if we get an SQL error. Sets
                      abort-source-on-error to 0
  -G, --named-commands 
                      Enable named commands. Named commands mean this program's
                      internal commands; see mysql> help . When enabled, the
                      named commands can be used from any line of the query,
                      otherwise only from the first line, before an enter.
                      Disable with --disable-named-commands. This option is
                      disabled by default.
  -i, --ignore-spaces Ignore space after function names.
  --init-command=name SQL Command to execute when connecting to MariaDB server.
                      Will automatically be re-executed when reconnecting.
  --local-infile      Enable/disable LOAD DATA LOCAL INFILE.
  -b, --no-beep       Turn off beep on error.
  -h, --host=name     Connect to host.
  -H, --html          Produce HTML output.
  -X, --xml           Produce XML output.
  --line-numbers      Write line numbers for errors.
                      (Defaults to on; use --skip-line-numbers to disable.)
  -L, --skip-line-numbers 
                      Don't write line number for errors.
  -n, --unbuffered    Flush buffer after each query.
  --column-names      Write column names in results.
                      (Defaults to on; use --skip-column-names to disable.)
  -N, --skip-column-names 
                      Don't write column names in results.
  --sigint-ignore     Ignore SIGINT (CTRL-C).
  -o, --one-database  Ignore statements except those that occur while the
                      default database is the one named at the command line.
  --pager[=name]      Pager to use to display results. If you don't supply an
                      option, the default pager is taken from your ENV variable
                      PAGER. Valid pagers are less, more, cat [> filename],
                      etc. See interactive help (\h) also. This option does not
                      work in batch mode. Disable with --disable-pager. This
                      option is disabled by default.
  -p, --password[=name] 
                      Password to use when connecting to server. If password is
                      not given it's asked from the tty.
  -P, --port=#        Port number to use for connection or 0 for default to, in
                      order of preference, my.cnf, $MYSQL_TCP_PORT,
                      /etc/services, built-in default (3306).
  --progress-reports  Get progress reports for long running commands (like
                      ALTER TABLE)
                      (Defaults to on; use --skip-progress-reports to disable.)
  --prompt=name       Set the command line prompt to this value.
  --protocol=name     The protocol to use for connection (tcp, socket, pipe).
  -q, --quick         Don't cache result, print it row by row. This may slow
                      down the server if the output is suspended. Doesn't use
                      history file.
  -r, --raw           Write fields without conversion. Used with --batch.
  --reconnect         Reconnect if the connection is lost. Disable with
                      --disable-reconnect. This option is enabled by default.
                      (Defaults to on; use --skip-reconnect to disable.)
  -s, --silent        Be more silent. Print results with a tab as separator,
                      each row on new line.
  -S, --socket=name   The socket file to use for connection.
  --ssl               Enable SSL for connection (automatically enabled with
                      other flags).
  --ssl-ca=name       CA file in PEM format (check OpenSSL docs, implies
                      --ssl).
  --ssl-capath=name   CA directory (check OpenSSL docs, implies --ssl).
  --ssl-cert=name     X509 cert in PEM format (implies --ssl).
  --ssl-cipher=name   SSL cipher to use (implies --ssl).
  --ssl-key=name      X509 key in PEM format (implies --ssl).
  --ssl-crl=name      Certificate revocation list (implies --ssl).
  --ssl-crlpath=name  Certificate revocation list path (implies --ssl).
  --tls-version=name  TLS protocol version for secure connection.
  --ssl-verify-server-cert 
                      Verify server's "Common Name" in its cert against
                      hostname used when connecting. This option is disabled by
                      default.
  -t, --table         Output in table format.
  --tee=name          Append everything into outfile. See interactive help (\h)
                      also. Does not work in batch mode. Disable with
                      --disable-tee. This option is disabled by default.
  -u, --user=name     User for login if not current user.
  -U, --safe-updates  Only allow UPDATE and DELETE that uses keys.
  -U, --i-am-a-dummy  Synonym for option --safe-updates, -U.
  -v, --verbose       Write more. (-v -v -v gives the table output format).
  -V, --version       Output version information and exit.
  -w, --wait          Wait and retry if connection is down.
  --connect-timeout=# Number of seconds before connection timeout.
  --max-allowed-packet=# 
                      The maximum packet length to send to or receive from
                      server.
  --net-buffer-length=# 
                      The buffer size for TCP/IP and socket communication.
  --select-limit=#    Automatic limit for SELECT when using --safe-updates.
  --max-join-size=#   Automatic limit for rows in a join when using
                      --safe-updates.
  --secure-auth       Refuse client connecting to server if it uses old
                      (pre-4.1.1) protocol.
  --server-arg=name   Send embedded server this as a parameter.
  --show-warnings     Show warnings after every statement.
  --plugin-dir=name   Directory for client-side plugins.
  --default-auth=name Default authentication client-side plugin to use.
  --binary-mode       By default, ASCII '\0' is disallowed and '\r\n' is
                      translated to '\n'. This switch turns off both features,
                      and also turns off parsing of all clientcommands except
                      \C and DELIMITER, in non-interactive mode (for input
                      piped to mysql or loaded using the 'source' command).
                      This is necessary when processing output from mysqlbinlog
                      that may contain blobs.
  --connect-expired-password 
                      Notify the server that this client is prepared to handle
                      expired password sandbox mode even if --batch was
                      specified.

Variables (--variable-name=value)
and boolean options {FALSE|TRUE}  Value (after reading options)
--------------------------------- ----------------------------------------
abort-source-on-error             FALSE
auto-rehash                       TRUE
auto-vertical-output              FALSE
binary-as-hex                     FALSE
character-sets-dir                (No default value)
column-type-info                  FALSE
comments                          FALSE
compress                          FALSE
debug-check                       FALSE
debug-info                        FALSE
database                          (No default value)
default-character-set             auto
delimiter                         ;
vertical                          FALSE
force                             FALSE
named-commands                    FALSE
ignore-spaces                     FALSE
init-command                      (No default value)
local-infile                      FALSE
no-beep                           FALSE
host                              (No default value)
html                              FALSE
xml                               FALSE
line-numbers                      TRUE
unbuffered                        FALSE
column-names                      TRUE
sigint-ignore                     FALSE
port                              0
progress-reports                  TRUE
prompt                            \N [\d]> 
protocol                          
quick                             FALSE
raw                               FALSE
reconnect                         TRUE
socket                            (No default value)
ssl                               FALSE
ssl-ca                            (No default value)
ssl-capath                        (No default value)
ssl-cert                          (No default value)
ssl-cipher                        (No default value)
ssl-key                           (No default value)
ssl-crl                           (No default value)
ssl-crlpath                       (No default value)
tls-version                       (No default value)
ssl-verify-server-cert            FALSE
table                             FALSE
user                              (No default value)
safe-updates                      FALSE
i-am-a-dummy                      FALSE
connect-timeout                   0
max-allowed-packet                16777216
net-buffer-length                 16384
select-limit                      1000
max-join-size                     1000000
secure-auth                       FALSE
show-warnings                     FALSE
plugin-dir                        (No default value)
default-auth                      (No default value)
binary-mode                       FALSE
connect-expired-password          FALSE
shy@EveningBreadui-MacBookPro ~ % mysql -u root -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
shy@EveningBreadui-MacBookPro ~ % mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 203
Server version: 8.0.26 MySQL Community Server - GPL

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [(none)]>

> 테이블 조회한것

MySQL [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| vueSpring          |
+--------------------+
5 rows in set (0.011 sec)

MySQL [(none)]> use vueSpring
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MySQL [vueSpring]> show tables;
+---------------------+
| Tables_in_vuespring |
+---------------------+
| MEMBER              |
| USER                |
+---------------------+
2 rows in set (0.004 sec)

MySQL [vueSpring]> select * from USER;
+-----+------------+
| SEQ | NAME       |
+-----+------------+
|   1 | ayoteralab |
+-----+------------+
1 row in set (0.000 sec)

MySQL [vueSpring]>

> 마리아DB 문법 참고: https://www.codingfactory.net/11437

 

MariaDB / 사용자 비밀번호 변경하는 방법

mysql 사용 use mysql 사용자와 비밀번호 출력하기 select user, password from user; abc 사용자의 비밀번호를 1234로 설정 update user set password=password('1234') where user='abc'; 변경사항 적용 flush privileges;

www.codingfactory.net

> Spring Boot Dependency
https://wakestand.tistory.com/444

 

스프링부트 Dependency 추가 삭제방법

스프링부트에서 Dependency 추가/삭제 방법은 프로젝트 삭제 후 새로 만드는 것이 아니라 프로젝트 우클릭 후 Spring > Add Starters를 눌러주자 여기서 원하는 Starter Project Dependencies를 선택해 준 후 Fi..

wakestand.tistory.com

3.Spring Boot + Mysql 연동 설정
https://memostack.tistory.com/156

<application.properties>

server.address=localhost
server.port=8080

spring.datasource.url=jdbc:mysql://localhost:3306/vueSpring?useSSL=false&characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.username=root
spring.datasource.password=HyShim0987!@#
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

# mysql 사용
spring.jpa.database=mysql
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect

# 로깅 레벨
logging.level.org.hibernate=info

# 하이버네이트가 실행한 모든 SQL문을 콘솔로 출력
spring.jpa.properties.hibernate.show_sql=true
# SQL문을 가독성 있게 표현
spring.jpa.properties.hibernate.format_sql=true
# 디버깅 정보 출력
spring.jpa.properties.hibernate.use_sql_comments=true

<pom.xml>

		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<scope>runtime</scope>
		</dependency>

Mybatis 연동
http://tech.javacafe.io/2018/07/31/mybatis-with-spring/

https://velog.io/@yeccye/Vue.js-SpringBoot-MyBatis

에러참고: jdbcUrl is required with driverClassName
https://dev-yujji.tistory.com/15

 

[Error] jdbcUrl is required with driverClassName.

jdbcUrl is required with driverClassName. 이라는 에러가 나왔다. Spring boot에서 MySQL을 연동하는 과정에서 나온 에러이다. 해결 : application.properties에 설정해둔 원래 코드는 이러 했다. spring.da..

dev-yujji.tistory.com

참고: Spring 어노테이션관련 정리
https://mkil.tistory.com/456

 

Spring Boot Annotation 정리

어노테이션은 이름만 봐도 얼추 기능에 대한 설명이 유추된다지만 그렇지 않은 어노테이션도 있고..해서 Spring Boot 스터디를 하게 된 김에 어노테이션도 정리해본다 :) SpringBoot에서 사용하는 어

mkil.tistory.com

참고: 서버 포트 변경
https://jason-moon.tistory.com/104

 

SpringBoot 서버 포트 변경하기

스프링부트(Spring Boot)를 사용할때, 서버의 포트를 변경하려면, 스프링부트 설정 파일인, application.properties에 설정을 추가하면 된다. 기본적으로 8080이지만, server.port = 8080 위와 같이, 변경할 포..

jason-moon.tistory.com

4.Swagger 적용
https://ayoteralab.tistory.com/entry/Spring-Boot-06-Swagger-%EA%B5%AC%EC%84%B1%ED%95%98%EA%B8%B0?category=860804

http://localhost:8010/swagger-ui.html

CORS 적용 (API)
https://shinsunyoung.tistory.com/86

CORS 적용 (Swagger 사용 시 추가)
https://stackoverflow.com/questions/43545540/swagger-ui-no-mapping-found-for-http-request

출처: https://webzil.tistory.com/139 [Web and Dev.... webzil.tistory.com]

'Tesk > vue.js' 카테고리의 다른 글

Vue Spring Boot 연습  (0) 2021.08.17
ㄷ.Vue & Spring Boot: 데이터  (1) 2021.08.12
ㄴ.Vue & Spring Boot: Axios 연결 연습  (0) 2021.08.11
ㄱ.Vue & Spring Boot 게시판 및 로그인  (1) 2021.08.10
210626-React.js()  (0) 2021.06.26
Comments