Open morteza57 opened 8 years ago
Hola, se que no es MySQL, pero con esta BD en PostgreSQL pude hacer correr el proyecto, solo debes migrarla a MySQL
-- Dumped from database version 9.1.21 -- Dumped by pg_dump version 9.1.21 -- Started on 2016-04-18 22:56:54 VET
SET statement_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SET check_function_bodies = false; SET client_min_messages = warning;
-- TOC entry 1 (class 3079 OID 11645)
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
-- TOC entry 1882 (class 0 OID 0) -- Dependencies: 1
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
-- TOC entry 165 (class 1259 OID 24616) -- Dependencies: 6
CREATE TABLE role ( id integer NOT NULL, name character(50) NOT NULL );
ALTER TABLE public.role OWNER TO postgres;
-- TOC entry 164 (class 1259 OID 24614) -- Dependencies: 165 6
CREATE SEQUENCE role_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER TABLE public.role_id_seq OWNER TO postgres;
-- TOC entry 1883 (class 0 OID 0) -- Dependencies: 164
ALTER SEQUENCE role_id_seq OWNED BY role.id;
-- TOC entry 163 (class 1259 OID 24608) -- Dependencies: 6
CREATE TABLE "user" ( id integer NOT NULL, name character(50) NOT NULL, login character(50) NOT NULL, password character(50) NOT NULL );
ALTER TABLE public."user" OWNER TO postgres;
-- TOC entry 162 (class 1259 OID 24606) -- Dependencies: 163 6
CREATE SEQUENCE user_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
ALTER TABLE public.user_id_seq OWNER TO postgres;
-- TOC entry 1884 (class 0 OID 0) -- Dependencies: 162
ALTER SEQUENCE user_id_seq OWNED BY "user".id;
-- TOC entry 166 (class 1259 OID 24622) -- Dependencies: 6
CREATE TABLE user_role ( user_id integer, role_id integer );
ALTER TABLE public.user_role OWNER TO postgres;
-- TOC entry 1762 (class 2604 OID 24619) -- Dependencies: 164 165 165
ALTER TABLE ONLY role ALTER COLUMN id SET DEFAULT nextval('role_id_seq'::regclass);
-- TOC entry 1761 (class 2604 OID 24611) -- Dependencies: 163 162 163
ALTER TABLE ONLY "user" ALTER COLUMN id SET DEFAULT nextval('user_id_seq'::regclass);
-- TOC entry 1873 (class 0 OID 24616) -- Dependencies: 165 1875
COPY role (id, name) FROM stdin;
1 ROLE_USER
2 ROLE_ADMIN
3 ROLE_GUEST
.
-- TOC entry 1885 (class 0 OID 0) -- Dependencies: 164
SELECT pg_catalog.setval('role_id_seq', 1, false);
-- TOC entry 1871 (class 0 OID 24608) -- Dependencies: 163 1875
COPY "user" (id, name, login, password) FROM stdin;
1 Roy roy spring
2 Craig craig spring
3 Greg greg spring
.
-- TOC entry 1886 (class 0 OID 0) -- Dependencies: 162
SELECT pg_catalog.setval('user_id_seq', 1, false);
-- TOC entry 1874 (class 0 OID 24622) -- Dependencies: 166 1875
COPY user_role (user_id, role_id) FROM stdin; 1 1 1 2 2 1 3 1 .
-- TOC entry 1766 (class 2606 OID 24621) -- Dependencies: 165 165 1876
ALTER TABLE ONLY role ADD CONSTRAINT role_pkey PRIMARY KEY (id);
-- TOC entry 1764 (class 2606 OID 24613) -- Dependencies: 163 163 1876
ALTER TABLE ONLY "user" ADD CONSTRAINT user_pkey PRIMARY KEY (id);
-- TOC entry 1768 (class 2606 OID 24630) -- Dependencies: 1765 166 165 1876
ALTER TABLE ONLY user_role ADD CONSTRAINT user_role_role_id_fkey FOREIGN KEY (role_id) REFERENCES role(id);
-- TOC entry 1767 (class 2606 OID 24625) -- Dependencies: 163 166 1763 1876
ALTER TABLE ONLY user_role ADD CONSTRAINT user_role_user_id_fkey FOREIGN KEY (user_id) REFERENCES "user"(id);
-- TOC entry 1881 (class 0 OID 0) -- Dependencies: 6
REVOKE ALL ON SCHEMA public FROM PUBLIC; REVOKE ALL ON SCHEMA public FROM postgres; GRANT ALL ON SCHEMA public TO postgres; GRANT ALL ON SCHEMA public TO PUBLIC;
-- Completed on 2016-04-18 22:56:54 VET
Dear my friend,
First of all please write the messages in English, and i don't need to create tables and schema in database i need how to connect the sample project to database like Mysql,Thank you in advance.
Dear "Morteza57". I've used MySQL in this app https://github.com/Pivopil/spring-boot-oauth2-rest-service-password-encoding. Use code and properties from "rest" module to configure your app. All the best.
Hello my friends how can connect this project to Mysql database and create tables and read and write to that tables.