Correct MySQL configuration for Ruby on Rails Database.yml file
You should separate the host from the port number.You could have something, like:
development: adapter: mysql2 encoding: utf8 database: my_db_name username: root password: my_password host: 127.0.0.1 port: 3306
You also can do like this:
default: &default adapter: mysql2 encoding: utf8 username: root password: host: 127.0.0.1 port: 3306development: <<: *default database: development_db_nametest: <<: *default database: test_db_nameproduction: <<: *default database: production_db_name
Use 'utf8mb4' as encoding to cover all unicode (including emojis)
default: &default adapter: mysql2 encoding: utf8mb4 collation: utf8mb4_bin username: <%= ENV.fetch("MYSQL_USERNAME") %> password: <%= ENV.fetch("MYSQL_PASSWORD") %> host: <%= ENV.fetch("MYSQL_HOST") %>