Open overflowwebdesigns opened 8 years ago
Hi,
I have the same problem. I'm using ubuntu 16.04 with rails 3.2.22, ruby 2.3.0p0 (2015-12-25) [x86_64-linux-gnu], mysql Ver 14.14 Distrib 5.7.12, for Linux (x86_64) using EditLine wrapper. From what, I understood, rake db:autoupgrade seems to have some problem. I don't know much more .... I guess the problem is beyond the scope of this project...
development.log: SQL (0.305ms) SET SESSION sql_mode = 'ANSI,NO_BACKSLASH_ESCAPES,NO_DIR_IN_CREATE,NO_ENGINE_SUBSTITUTION,NO_UNSIGNED_SUBTRACTION,TRADITIONAL' You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 1 (code: 1064, sql state: 42000, query: SHOW TABLES LIKE ', uri: mysql:root@localhostsnorby?database=snorby&path=snorby&adapter=mysql&username=user&password=passwd&host=localhost)
trace:
bundle exec rake snorby:setup --trace --verbose
Jammit Warning: Asset compression disabled -- Java unavailable.
No time_zone specified in snorby_config.yml; detected time_zone: Europe/Paris
* Invoke snorby:setup (first_time)
* Invoke environment (first_time)
* Execute environment
* Execute snorby:setup
* Invoke secret (first_time)
* Execute secret
XX
* Invoke db:create (first_time)
* Invoke environment
* Execute db:create
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1007 (HY000) at line 1: Can't create database 'snorby'; database exists
* Invoke snorby:update (first_time)
* Invoke environment
* Execute snorby:update
* Invoke db:autoupgrade (first_time)
* Invoke environment
\ Execute db:autoupgrade
rake aborted!
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 1
/var/lib/gems/2.3.0/gems/dm-do-adapter-1.2.0/lib/dm-do-adapter/adapter.rb:34:in execute_reader' /var/lib/gems/2.3.0/gems/dm-do-adapter-1.2.0/lib/dm-do-adapter/adapter.rb:34:in
block in select'
/var/lib/gems/2.3.0/gems/dm-do-adapter-1.2.0/lib/dm-do-adapter/adapter.rb:276:in with_connection' /var/lib/gems/2.3.0/gems/dm-do-adapter-1.2.0/lib/dm-do-adapter/adapter.rb:33:in
select'
/var/lib/gems/2.3.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-mysql-adapter.rb:22:in storage_exists?' /var/lib/gems/2.3.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:90:in
create_model_storage'
/var/lib/gems/2.3.0/gems/dm-migrations-1.2.0/lib/dm-migrations/adapters/dm-do-adapter.rb:57:in upgrade_model_storage' /var/lib/gems/2.3.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:73:in
upgrade_model_storage'
/var/lib/gems/2.3.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:145:in auto_upgrade!' /var/lib/gems/2.3.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:47:in
block in repository_execute'
/var/lib/gems/2.3.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:46:in each' /var/lib/gems/2.3.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:46:in
repository_execute'
/var/lib/gems/2.3.0/gems/dm-migrations-1.2.0/lib/dm-migrations/auto_migration.rb:27:in auto_upgrade!' /var/lib/gems/2.3.0/gems/dm-rails-1.2.1/lib/dm-rails/railties/database.rake:47:in
block (3 levels) in <top (required)>'
/var/lib/gems/2.3.0/gems/dm-rails-1.2.1/lib/dm-rails/railties/database.rake:46:in each' /var/lib/gems/2.3.0/gems/dm-rails-1.2.1/lib/dm-rails/railties/database.rake:46:in
block (2 levels) in <top (required)>'
/var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:205:in block in execute' /var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:200:in
each'
/var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:200:in execute' /var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:158:in
block in invoke_with_call_chain'
/usr/lib/ruby/2.3.0/monitor.rb:214:in mon_synchronize' /var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:151:in
invoke_with_call_chain'
/var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:144:in invoke' /home/user/Documents/snorby/snorby/lib/tasks/snorby.rake:40:in
block (2 levels) in <top (required)>'
/var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:205:in block in execute' /var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:200:in
each'
/var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:200:in execute' /var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:158:in
block in invoke_with_call_chain'
/usr/lib/ruby/2.3.0/monitor.rb:214:in mon_synchronize' /var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:151:in
invoke_with_call_chain'
/var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:144:in invoke' /home/user/Documents/snorby/snorby/lib/tasks/snorby.rake:33:in
block (2 levels) in <top (required)>'
/var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:205:in block in execute' /var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:200:in
each'
/var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:200:in execute' /var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:158:in
block in invoke_with_call_chain'
/usr/lib/ruby/2.3.0/monitor.rb:214:in mon_synchronize' /var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:151:in
invoke_with_call_chain'
/var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/task.rb:144:in invoke' /var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/application.rb:112:in
invoke_task'
/var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/application.rb:90:in block (2 levels) in top_level' /var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/application.rb:90:in
each'
/var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/application.rb:90:in block in top_level' /var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/application.rb:129:in
standard_exception_handling'
/var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/application.rb:84:in top_level' /var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/application.rb:62:in
block in run'
/var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/application.rb:129:in standard_exception_handling' /var/lib/gems/2.3.0/gems/rake-0.9.2/lib/rake/application.rb:59:in
run'
/var/lib/gems/2.3.0/gems/rake-0.9.2/bin/rake:32:in <top (required)>' /usr/local/bin/rake:23:in
load'
/usr/local/bin/rake:23:in `
I'm having the same problem and am also using Xenial (Ubuntu 16.04).
mysql --version mysql Ver 14.14 Distrib 5.7.12, for Linux (x86_64) using EditLine wrapper
I am getting the exact same error, I am also running 'mysql Ver 14.14 Distrib 5.7.12, for Linux (x86_64) using EditLine wrapper' on Ubuntu 16.04
Due to changes in mysql 5.7, the do_mysql 0.10.16 gem no longer works. The bug was reported and fixed here: https://github.com/datamapper/do/issues/88
To fix edit your Gemfile.lock
' - do_mysql (~> 0.10.6)' '+ do_mysql (~> 0.10.17)'
'- do_mysql (0.10.16)' '+ do_mysql (0.10.17) '
I have submitted a pull request
Confirmed that this resolved the issue for me in the script I've been constructing. Just testing today on Xenial. Hopefully this gets rolled up into master soon so I don't need my exception handling.
thanks mate... works, after edit the Gemfile.lock
bundle install
to upgrade the modules. and the
bundle exec rake snorby:setup
I had to run the gem install manually: gem install do_mysql -v 0.10.17
Otherwise, this looks like it worked.
Hi all - when running rake snorby:setup I get the following errors. The script creates the DB but then errors out and no tables are created. I have been following the instructions on install and can not seem to figure this out. I am runnng FreeBSD. Any help is greatly appreciated!
` root@snort01:~/snorby # bundle exec rake snorby:setup Jammit Warning: Asset compression disabled -- Java unavailable. syck has been removed, psych is used instead No time_zone specified in snorby_config.yml; detected time_zone: America/New_York 80901a42ad1ac11f15f334517a86ebb034cd1b6f9cfd3e98e7c05b8cbb7b8d7b75bc8b336400c559e1eae3f26e40c9b10ef5187ca4a5b4c922ef444491efe6126 mysql: [Warning] Using a password on the command line interface can be insecure. [datamapper] Created database 'snorby' rake aborted! You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 1
Tasks: TOP => db:autoupgrade (See full trace by running task with --trace) root@snort01:~/snorby # `