Posted over 11 years ago by Henning Koch.

...to delete rows from a table, and the delete conditions require a joined table, MySQL needs to know which table you want to delete from. Let's say that Post...

Posted over 11 years ago by Henning Koch.

ALTER DATABASE database_name CHARACTER SET "utf8"; ALTER DATABASE database_name COLLATE "utf8_unicode_ci"; After that, for...

Posted about 10 years ago by Henning Koch.

When selecting records in a date range, take care not to do it like this: start_date = Date.parse('2007-05...

Posted almost 6 years ago by Thomas Eisenbarth.

You can find out about disk space usage of all tables within your database by running this: SELECT table_name...

Posted almost 7 years ago by Thomas Eisenbarth.

SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'your_database' order by table_rows;

Posted over 9 years ago by Thomas Eisenbarth. dev.mysql.com

Take care in queries where multiple AND or OR operators are used. In doubt, always use braces to enforce precedence...

Posted over 9 years ago by Henning Koch. derwiki.tumblr.com

Some advice for bulk loading many records into InnoDB and finishing before the sun burns out. Use with care.

Posted almost 10 years ago by Henning Koch.

Possible Reason 1: parallel_tests - running more processes than features If you run old versions of parallel_tests with more...

Posted over 10 years ago by Ulrich Berkmueller.

Given the problem you have a new column postion and that column should be updated for all existing rows with...

Posted almost 11 years ago by Henning Koch.

You will occasionally need to clean out your database while keeping the schema intact, e.g. when someone inserted data in...

Posted about 11 years ago by Arne Hartherz.

If you need to do calculations inside the database and can not use Ruby objects you may run into problems...

Posted over 2 years ago by Tobias Kraze.

...server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? Connection to the MySQL database does not work anymore Your travis-ci builds might have started failing on the...

mysql -e 'create database IF NOT EXISTS minidusen_test;' with an error ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) The command "mysql...

Posted over 1 year ago by Tobias Kraze.

...If necessary (i.e. the tests use databases), add a spec/support/database.github.yml file with this content: mysql: database: test username: root password: password host: 127.0.0.1 port: 3306 postgresql: database: test host: localhost...

...version that is actually in the matrix. You might run into issues with the mysql2 gem, including issues bundling, and even segfaults. Use this card to fix these issues.

Posted almost 3 years ago by Arne Hartherz.

...rake db:migrate" on an empty # database, we swallow such errors. end end For MySQL, rescue Mysql2::Error, ActiveRecord::StatementInvalid might be fitting...

Posted about 3 years ago by Dominik Schöler.

...e.g. rails console staging Gem updates Replace ruby-debug with byebug or pry Replace mysql with mysql2, '< 0.3' Remove oniguruma Remove net-ssh and net-scp Remove fastercsv Remove cucumber...

Posted over 11 years ago by Tobias Kraze.

...calculations, e.g. 10 AM CEST minus 8 AM UTC is zero. A datetime in MySQL does not have a zone. It just stores the literal string...

...That means that Rails must make assumptions about timestamps loaded from and written to MySQL. Rails has two completely different modes of dealing with this. We also prefer to use...

Posted almost 7 years ago by Henning Koch.

...thought. While you can call ActiveRecord::Base.connection.execute(sql) to execute arbitrary SQL commands, the MySQL connection is configured to only accept a single statement per query. If you try to...

...error in your SQL syntax. You can work around this by opening a second MySQL connection that does accept multiple statements per call. Below is an example for a migration...

Posted almost 4 years ago by Florian Heinle. github.com

...working directory and ~/dumps (for dumps created with geordi). geordi drop_databases Delete local MySQL/MariaDB and Postgres databases that are not whitelisted. Authentication is handled via PAM for Postgres and...

...MariaDB, via .my.cnf with fallback to mysql -p for MySQL. Different connection methods can be chosen via command line switches, e.g. for cleaning up multiple local database server installations in...

This website uses short-lived cookies to improve usability.
Accept or learn more