foradian / fluxday

A user-friendly, free & opensource task & productivity management tool for growing startups
http://fluxday.io/
Apache License 2.0
476 stars 173 forks source link

Unable to Install , DB Creation Issue #11

Closed plan889 closed 8 years ago

plan889 commented 8 years ago

when i run this command.

rake db:create

Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "database"=>"tracker_development", "pool"=>5, "username"=>"root", "password"=>"foradian", "socket"=>"/var/run/mysqld/mysqld.sock"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}

I have created tracker_development, tracker_test, tracker_production with utf8_unicode_ci and I have a root user with no password

my database.yml looks like this

MySQL. Versions 4.1 and 5.0 are recommended.

Install the MYSQL driver

gem install mysql2

Ensure the MySQL gem is defined in your Gemfile

gem 'mysql2'

And be sure to use new-style password hashing:

http://dev.mysql.com/doc/refman/5.0/en/old-client.html

development: adapter: mysql2 encoding: utf8 database: tracker_development pool: 5 username: root password: socket: /var/run/mysqld/mysqld.sock

Warning: The database defined as "test" will be erased and

re-generated from your development database when you run "rake".

Do not set this db to the same as development or production.

test: adapter: mysql2 encoding: utf8 database: tracker_test pool: 5 username: root password: socket: /var/run/mysqld/mysqld.sock

production: adapter: mysql2 encoding: utf8 database: tracker_production pool: 5 username: root password: socket: /var/run/mysqld/mysqld.sock

I am new to ruby.. let me know if I am doing anything wrong.

Thank You

shyam1210 commented 8 years ago

Comment out the "socket: /var/run/mysqld/mysqld.sock" line in your database.yml file

plan889 commented 8 years ago

That issue is solved.

Now I am facing another issue when i tried to run .. please help

rake db:migrate == CreateProjects: migrating ================================================= -- create_table(:projects) rake aborted! StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead: CREATE TABLE projects (id int(11) DEFAULT NULL auto_increment PRIMARY KEY, name varchar(255), code varchar(255), description text, is_deleted tinyint(1) DEFAULT 0, created_at datetime, updated_at datetime) ENGINE=InnoDB /Library/Ruby/Gems/2.0.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:in _query' /Library/Ruby/Gems/2.0.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:80:inblock in query' /Library/Ruby/Gems/2.0.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:in handle_interrupt' /Library/Ruby/Gems/2.0.0/gems/mysql2-0.3.21/lib/mysql2/client.rb:79:inquery' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:287:in block in execute' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:435:inblock in log' /Library/Ruby/Gems/2.0.0/gems/activesupport-4.0.3/lib/active_support/notifications/instrumenter.rb:20:in instrument' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:430:inlog' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:287:in execute' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/mysql2_adapter.rb:222:inexecute' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:190:in create_table' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:471:increate_table' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:625:in block in method_missing' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:597:inblock in say_with_time' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:597:in say_with_time' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:617:inmethod_missing' /Applications/XAMPP/xamppfiles/htdocs/fluxday/db/migrate/20140313044626_create_projects.rb:3:in change' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:571:inexec_migration' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:555:in block (2 levels) in migrate' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:554:inblock in migrate' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in with_connection' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:553:inmigrate' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:709:in migrate' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:959:inblock in execute_migration_in_transaction' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:1007:in ddl_transaction' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:958:inexecute_migration_in_transaction' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:920:in block in migrate' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:916:ineach' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:916:in migrate' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:764:inup' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/migration.rb:742:in migrate' /Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.3/lib/active_record/railties/databases.rake:42:inblock (2 levels) in <top (required)>' Tasks: TOP => db:migrate (See full trace by running task with --trace)

Thank You

tachyons commented 8 years ago

Duplicate of #5