이 콘텐츠는 선택한 언어로 제공되지 않습니다.
2.2. Using MySQL as the Default DataSource
The MySQL® database has become the world's most popular open source database thanks to its consistent fast performance, high reliability and ease of use. This database server is used in millions of installations ranging from large corporations to specialized embedded applications across every continent of the world. The official JDBC driver is called
Connector/J. For this example we’ve used MySQL 5.1.31 and Connector/J 5.1.8. Both are available at http://www.mysql.com.
2.2.1. Creating a Database and User 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
We’ll assume that you’ve already installed MySQL and that you have it running and are familiar with the basics. Run the MySQL client program from the command line so we can execute some administration commands. You should make sure that you are connected as a user with sufficient privileges (for example, by specifying the
-u root option to run as the MySQL root user).
First create a database called
jboss within MySQL for use by JBoss:
mysql> CREATE DATABASE jboss; Query OK, 1 row affected (0.05 sec)
mysql> CREATE DATABASE jboss;
Query OK, 1 row affected (0.05 sec)
Then check that it has been created:
Next, create a user called
jboss with 'password' as the password to access the database:
mysql> GRANT ALL PRIVILEGES ON jboss.* TO jboss@localhost IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.06 sec)
mysql> GRANT ALL PRIVILEGES ON jboss.* TO jboss@localhost IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.06 sec)
Again, you can check that everything has gone smoothly: