Convert Rails Sqlite To Mysql
Convert Rails SQLlite to use MySQL#
-
In
Gemfile
: Replacegem 'sqllite3'
togem 'mysql2'
-
Change the database configuration
config/database.yml
:
default: &default
adapter: mysql2
encoding: utf8
pool: 5
timeout: 5000
username: <yourusername>
password: <yourpassword>
socket: /var/run/mysqld/mysqld.sock
development:
<<: *default
database: apiflysaa_dev
Check Socket#
mysqladmin -u root -p variables | grep socket
Giving Permissions#
GRANT ALL PRIVILEGES ON dbTest.* To
'user'@'hostname' IDENTIFIED BY 'password';
Source: