7日目:DataBaseが作成できた
マニュアル本の通りにやっているので、本来、作れて当たり前なのですが……。
今回のハマリどころは、DSNの書き間違いでした。
使っている DataBase名が PodTV2なのに PodTVと設定してしまっていました。
なんで 2がついているかというと、PodTVというデータベースは、現行バージョンで使ってしまっているからです。
なんかエラーが出ているところもありますが、これで大丈夫なんでしょうか?
/var/www/podtv/config/propel.ini
propel.targetPackage = lib.model propel.packageObjectModel = true propel.project = podtv propel.database = mysql propel.database.createUrl = mysql://sido:xxxxxx@localhost/ propel.database.url = mysql://sido:xxxxxx@localhost/podtv2 propel.mysql.tableType = InnoDB
/var/www/podtv/config/databes.yml
all: propel: class: sfPropelDatabase param: dsn: mysql://sido:xxxxxx@localhost/podtv2 encoding: utf8
$ symfony propel-build-all
[sido @ localhost /var/www/podtv ] $ symfony propel-build-all >> schema converting "/var/www/podtv/config/schema.yml" to XML >> schema putting /var/www/podtv/config/generated-schema.xml >> schema converting "/var/www/podtv/plug...lugin/config/schema.yml" to XML >> schema putting /var/www/podtv/plugins/...erated-sfGuardPlugin-schema.xml >> file+ config/generated-sfGuardPlugin-schema.xml >> file- /var/www/podtv/plugins/sfGuardP...erated-sfGuardPlugin-schema.xml Buildfile: /usr/share/pear/symfony/vendor/propel-generator/build.xml [resolvepath] Resolved /var/www/podtv/config to /var/www/podtv/config propel-project-builder > check-project-or-dir-set: propel-project-builder > check-project-set: propel-project-builder > set-project-dir: propel-project-builder > check-buildprops-exists: propel-project-builder > check-buildprops-for-propel-gen: propel-project-builder > check-buildprops: propel-project-builder > configure: [echo] Loading project-specific props from /var/www/podtv/config/propel.ini [property] Loading /var/www/podtv/config/propel.ini propel-project-builder > om: [phing] Calling Buildfile '/usr/share/pear/symfony/vendor/propel-generator/build-propel.xml' with target 'om' [property] Loading /usr/share/pear/symfony/vendor/propel-generator/./default.properties propel > check-run-only-on-schema-change: propel > om-check: propel > om: [echo] +------------------------------------------+ [echo] | | [echo] | Generating Peer-based Object Model for | [echo] | YOUR Propel project! (NEW OM BUILDERS)! | [echo] | | [echo] +------------------------------------------+ [phingcall] Calling Buildfile '/usr/share/pear/symfony/vendor/propel-generator/build-propel.xml' with target 'om-template' [property] Loading /usr/share/pear/symfony/vendor/propel-generator/./default.properties propel > om-template: [propel-om] Target database type: mysql [propel-om] Target package: lib.model [propel-om] Using template path: /usr/share/pear/symfony/vendor/propel-generator/templates [propel-om] Output directory: /var/www/podtv [propel-om] Processing: generated-schema.xml [propel-om] Processing: schema.xml [propel-om] Processing: generated-sfGuardPlugin-schema.xml Execution of target "om-template" failed for the following reason: /usr/share/pear/symfony/vendor/propel-generator/build-propel.xml:470:1: Duplicate table found: propel. [phingcall] /usr/share/pear/symfony/vendor/propel-generator/build-propel.xml:470:1: Duplicate table found: propel. BUILD FINISHED Total time: 0.5722 seconds >> file- /var/www/podtv/config/generated-sfGuardPlugin-schema.xml >> file- /var/www/podtv/config/generated-schema.xml >> schema converting "/var/www/podtv/config/schema.yml" to XML >> schema putting /var/www/podtv/config/generated-schema.xml >> schema converting "/var/www/podtv/plug...lugin/config/schema.yml" to XML >> schema putting /var/www/podtv/plugins/...erated-sfGuardPlugin-schema.xml >> file+ config/generated-sfGuardPlugin-schema.xml >> file- /var/www/podtv/plugins/sfGuardP...erated-sfGuardPlugin-schema.xml Buildfile: /usr/share/pear/symfony/vendor/propel-generator/build.xml [resolvepath] Resolved /var/www/podtv/config to /var/www/podtv/config propel-project-builder > check-project-or-dir-set: propel-project-builder > check-project-set: propel-project-builder > set-project-dir: propel-project-builder > check-buildprops-exists: propel-project-builder > check-buildprops-for-propel-gen: propel-project-builder > check-buildprops: propel-project-builder > configure: [echo] Loading project-specific props from /var/www/podtv/config/propel.ini [property] Loading /var/www/podtv/config/propel.ini propel-project-builder > sql: [phing] Calling Buildfile '/usr/share/pear/symfony/vendor/propel-generator/build-propel.xml' with target 'sql' [property] Loading /usr/share/pear/symfony/vendor/propel-generator/./default.properties propel > check-run-only-on-schema-change: propel > sql-check: propel > pgsql-quoting-check: propel > sql: [echo] +------------------------------------------+ [echo] | | [echo] | Generating SQL for YOUR Propel project! | [echo] | | [echo] +------------------------------------------+ [phingcall] Calling Buildfile '/usr/share/pear/symfony/vendor/propel-generator/build-propel.xml' with target 'sql-template' [property] Loading /usr/share/pear/symfony/vendor/propel-generator/./default.properties propel > sql-template: [propel-sql] Processing: generated-schema.xml [propel-sql] Processing: schema.xml [propel-sql] Processing: generated-sfGuardPlugin-schema.xml Execution of target "sql-template" failed for the following reason: /usr/share/pear/symfony/vendor/propel-generator/build-propel.xml:187:1: Duplicate table found: propel. [phingcall] /usr/share/pear/symfony/vendor/propel-generator/build-propel.xml:187:1: Duplicate table found: propel. BUILD FINISHED Total time: 0.1816 seconds >> file- /var/www/podtv/config/generated-sfGuardPlugin-schema.xml >> file- /var/www/podtv/config/generated-schema.xml >> schema converting "/var/www/podtv/config/schema.yml" to XML >> schema putting /var/www/podtv/config/generated-schema.xml >> schema converting "/var/www/podtv/plug...lugin/config/schema.yml" to XML >> schema putting /var/www/podtv/plugins/...erated-sfGuardPlugin-schema.xml >> file+ config/generated-sfGuardPlugin-schema.xml >> file- /var/www/podtv/plugins/sfGuardP...erated-sfGuardPlugin-schema.xml Buildfile: /usr/share/pear/symfony/vendor/propel-generator/build.xml [resolvepath] Resolved /var/www/podtv/config to /var/www/podtv/config propel-project-builder > check-project-or-dir-set: propel-project-builder > check-project-set: propel-project-builder > set-project-dir: propel-project-builder > check-buildprops-exists: propel-project-builder > check-buildprops-for-propel-gen: propel-project-builder > check-buildprops: propel-project-builder > configure: [echo] Loading project-specific props from /var/www/podtv/config/propel.ini [property] Loading /var/www/podtv/config/propel.ini propel-project-builder > insert-sql: [phing] Calling Buildfile '/usr/share/pear/symfony/vendor/propel-generator/build-propel.xml' with target 'insert-sql' [property] Loading /usr/share/pear/symfony/vendor/propel-generator/./default.properties propel > insert-sql: [propel-sql-exec] Executing statements in file: /var/www/podtv/data/sql/plugins.sfGuardPlugin.lib.model.schema.sql [propel-sql-exec] Executing statements in file: /var/www/podtv/data/sql/lib.model.schema.sql [propel-sql-exec] Our new url -> mysql://sido:me31020m@localhost/podtv2 [propel-sql-exec] Executing file: /var/www/podtv/data/sql/plugins.sfGuardPlugin.lib.model.schema.sql [propel-sql-exec] Executing file: /var/www/podtv/data/sql/lib.model.schema.sql [propel-sql-exec] 20 of 20 SQL statements executed successfully BUILD FINISHED Total time: 1.4308 second >> file- /var/www/podtv/config/generated-sfGuardPlugin-schema.xml >> file- /var/www/podtv/config/generated-schema.xml [sido @ localhost /var/www/podtv ] $ mysql ERROR 1045 (28000): Access denied for user 'sido'@'localhost' (using password: NO) [sido @ localhost /var/www/podtv ] $ mysql -usido -p podtv2 Enter password: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 12 to server version: 5.0.22 Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use podtv2; Database changed mysql> show tables; +---------------------------+ | Tables_in_podtv2 | +---------------------------+ | sf_guard_group | | sf_guard_group_permission | | sf_guard_permission | | sf_guard_remember_key | | sf_guard_user | | sf_guard_user_group | | sf_guard_user_permission | | user | +---------------------------+ 8 rows in set (0.00 sec)