spring mysql datasouce

java 2015. 2. 8. 17:35

mysql> create user testuser;

Query OK, 0 rows affected (0.00 sec)


mysql> create user testuser@localhost identified by 'testuser';

Query OK, 0 rows affected (0.00 sec)


mysql> create schema test default character set utf8;

Query OK, 1 row affected (0.00 sec)


mysql> select host, user, password from user;

+-----------------------+----------+-------------------------------------------+

| host                  | user     | password                                  |

+-----------------------+----------+-------------------------------------------+

| localhost             | root     |                                           |

| skp1002428mn001.local | root     |                                           |

| 127.0.0.1             | root     |                                           |

| ::1                   | root     |                                           |

| localhost             |          |                                           |

| skp1002428mn001.local |          |                                           |

| %                     | testuser |                                           |

| localhost             | testuser | *3A2EB9C80F7239A4DE3933AE266DB76A7846BCB8 |

+-----------------------+----------+-------------------------------------------+

8 rows in set (0.00 sec)


mysql> grant all privileges on test.* to testuser@localhost;

Query OK, 0 rows affected (0.00 sec)


mysql> grant select, insert, update, delete on test.* to testuser@localhost;

Query OK, 0 rows affected (0.01 sec)


mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)




mysql -utestuser -ptestuser



    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">  

        <property name="driverClassName" value="com.mysql.jdbc.Driver" />

        <property name="url" value="jdbc:mysql://localhost:3306/test" />

        <property name="username" value="testuser" />

        <property name="password" value="testuser" />

    </bean>



'java' 카테고리의 다른 글

springboot connection pool 설정  (0) 2015.10.22
maven build 할때 mapper.xml 누락되는 현상  (0) 2015.03.05
쓰레드.. wait, notify, notifyAll  (0) 2014.07.09
Thread join 함수  (0) 2014.07.09
Spring - IoC & DI & AOP ( 퍼옴 )  (0) 2014.07.03
Posted by 무세1
,