Raible's Wiki
Raible Designs AppFuseHomepage- Korean - Chinese - Italian - Japanese QuickStart Guide User Guide Tutorials Other ApplicationsStruts ResumeSecurity Example Struts Menu
Set your name in
UserPreferences
Referenced by
JSPWiki v2.2.33
Hide Menu |
This is version 2.
It is not the current version, and thus it cannot be edited. 만약 당신이 mysql에 접근하는 root사용자 계정을 가지고 AppFuse데이터베이스 셋업을 할때 문제가 있다면, 당신은 다음의 단계중 하나를 수행할 필요가 있다. 목차
build.properties파일내 root사용자 비밀번호를 셋팅하라. [#1]mysql root사용자의 비밀번호를 셋팅하기 위해, build.properties파일을 편집하고 필요한 프라퍼티를 수정하라. #database.jar=${postgresql.jar} #database.type=postgresql #database.name=appfuse #database.host=localhost #database URL for creating other databases (doesn't work with pgsql) #database.admin.url=jdbc:${database.type}://${database.host}/template1 #database.admin.username=postgres #database.admin.password=postgres #hibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect #database.driver_class=org.postgresql.Driver #database.url=jdbc:${database.type}://${database.host}/${database.name} 당신은 이것처럼 보이는 비밀번호를 지정하는 줄의 주석을 제거해야한다. database.admin.password=myrootpassword myrootpassword라는 값을 당신의 mysql root사용자 비밀번호로 변경한다. 당신의 root계정이 정확하게 셋업되지 않았다. [#2]당신이 mysql에 로그인 할때, 당신이 사용할수 있는 많은 데이터베이스가 있다. 그 데이터베이스중 하나는 '시스템' 데이터베이스인 mysql이라고 불린다. mysql데이터베이스에, mysql의 모든 사용자 정보를 가지는 'users'라고 불리는 테이블이 있다. users테이블은 'host'칼럼을 포함한다. root사용자는 로그인을 시도하는 각각의 'host'를 위해 users테이블내 'host'칼럼값(예를 들면, 'mypc', 'localhost', 와일드카드인 '%')을 기입할 필요가 있다. 권한과 host칼럼은 실행을 원할하게 하기 위한 ant셋업을 위해 정확하게 셋업될 필요가 있다. These instructions tell you how to setup the root user with no password. Once you have ant setup successfully, you can set a password on the root account. For further information, you may wish to check the How to Reset the Root Password section of the MySQL Reference Manual. (Please note: You do not have to setup the root account in this way, it is possible to perform the following steps and give the root user a password, see [1]. But the following steps should work for you.) In this example, we will pretend your hostname is 'mypc'. Also, where ${MYSQL_HOME} is shown, please replace that with the path to your mysql installation. At the end of these steps, you should be able to login to your mysql database and see this: $ mysql -u root mysql> use mysql; Database changed mysql> select user, host, password from user where user = "root"; +------+-----------+----------+ | user | host | password | +------+-----------+----------+ | root | localhost | | | root | mypc | | | root | % | | +------+-----------+----------+ 3 rows in set (0.00 sec) and if you execute select * from user where user = "root"; we want to see Y's on all the grant columns within the user table, which denotes that the root user has all the neccesary grant options to be able to setup the appfuse database and give the test user privileges on it. First we want to stop the mysql db, so execute this command: mysqladmin -u root -p shutdown If mysql is still running (check the process on UNIX or use TaskManager on Windows), then kill the process: (UNIX) killall mysqld (Windows) Use task manager or stop the mysqld service Now we want to restart mysql but bypass the authentication tables so we can go in and change the user database table, so now execute this command. For UNIX: ${MYSQL_HOME}/bin/mysqld_safe --skip-grant-tables & For Windows, use the mysqld-nt command instead, also omit the ampersand: ${MYSQL_HOME}\bin\mysqld-nt --skip-grant-tables Now log back into mysql and remove any old root entries in your user table: mysql -u root use mysql; delete from user where user='root'; commit; FLUSH PRIVILEGES; Now we want to setup the root user using the GRANT command, so execute the following commands (Note you should change mypc to your hostname or hostname.domainname: mysql -u root use mysql; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES; GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES; GRANT ALL PRIVILEGES ON *.* TO 'root'@'mypc' WITH GRANT OPTION; FLUSH PRIVILEGES; quit; Note: If you want to set a root password at this stage (and then specify it build.properties as defined in [1]), then you need to modify the GRANT commands to: GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'myrootpassword' WITH GRANT OPTION; Replacing 'myrootpassword' to be what you want the mysql root user password to be. We now have the mysql root user setup properly, lets restart mysql without bypassing the authentication stuff.. Stop mysql using the instructions above once more. Now, if you run ant setup you should be ok, if you are still getting errors, it is likely you need to perform the steps in [3]. If you are up and running, you should not set the root password as described in [4]. The grants for the test user account are not being setup properly [#3]If you are seeing an error message that says: Invalid authorization specification message from server: "Access denied for user: 'test@mypc' (Using password: YES)" Then you need to change metadata/sql/mysql-create.sql to specify your hostname (along with your domain name if you have one, else just your hostname). Here is an example of what a modified file might look like if your hostname is 'mypc': create database if not exists appfuse; grant all privileges on appfuse.* to test@localhost identified by "test"; grant all privileges on appfuse.* to test@mypc identified by "test"; Set a password for your mysql root user [#4]To set the root password, type the following commands : $ mysql -u root mysql> use mysql; Database changed Now we want to set the password field for any root user records in the users table. Type this command: UPDATE user SET Password=PASSWORD('myrootpassword') WHERE User='root'; FLUSH PRIVILEGES; Where myrootpassword is your new mysql root user password.
|