Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. In addition to installing the MySQL database, you will also need to add the
  2. mysql gem to the Gemfile:
  3. Download depot_t/Gemfile
  4. group :production do
  5. gem 'mysql'
  6. end
  7. By putting this gem in group production, it will not be loaded when running
  8. in development or test. If you like, you can put sqlite3 gem into (separate)
  9. development and test groups.
  10. Install the gem using bundle install. You may need to locate and install the
  11. MySQL database development files for your operating system first. On Ubuntu,
  12. for example, you will need to install libmysqlclient-dev.
  13. You can use the mysql command-line client to create your database, or if you’re
  14. more comfortable with tools such as phpmyadmin or CocoaMySQL, go for it:
  15. depot> mysql -u root
  16. mysql> CREATE DATABASE depot_production;
  17. mysql> GRANT ALL PRIVILEGES ON depot_production.*
  18. -> TO 'username'@'localhost' IDENTIFIED BY 'password';
  19. mysql> EXIT;
  20. If you picked a different database name, remember it, because you will need to
  21. adjust the configuration file to match the name you picked. Let’s look at that
  22. configuration file now.
  23. The database.yml contains information on database connections. It contains
  24. three sections, one each for the development, test, and production databases.
  25. The current production section contains the following:
  26. production:
  27. adapter: sqlite3
  28. database: db/production.sqlite3
  29. pool: 5
  30. timeout: 5000
  31. We replace that section with something like the following:
  32. production:
  33. adapter: mysql
  34. encoding: utf8
  35. reconnect: false
  36. database: depot_production
  37. pool: 5
  38. username: username
  39. password: password
  40. host: localhost
  41. Change the username, password, and database fields as necessary.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement