...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...
...on the server (ls -l). In our case, it's 1234567890. Know your (local) MySQL root password. We'll use SECRET below. Know your (local) target database name. For us...
...my_project_development. Go wild: ^ ssh user@example.com "cat /mnt/dumps/my_project.dump.bz2" | pv -s 1234567890 | bzip2 -d | mysql -uroot -pSECRET my_project_development That will: Print the (bzipped) file to stdout on the...
...database server your application runs on. Like MAX or COUNT, GROUP_CONCAT is a MySQL aggregation function you can use whenever your query contains a GROUP BY. You can use...
...can lead to NULL distances in edge cases. The reason for this is that MySQL is performing several sine and cosine computations which can result in slight rounding errors -- which...
...to compute the arc cosine of a result like 1.0000000001. Since this is undefined, MySQL correctly returns NULL (instead of the expected distance of 0 for the circle's center...
When you work in the MySQL console and you want to see which database is used, type: SELECT database(); The result you see is the database you would activate with...
So you got this error, even though your Gemfile bundles mysql2: !!! Missing the mysql2 gem. Add it to your Gemfile: gem 'mysql2' or Please install the mysql adapter: `gem install...
...activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.) The reason for this confusing error message is probably that your Gemfile says mysql2, but your...
...in a DECIMAL field, and that number exceeds that column's precision or scale MySQL (strict mode) The database connection will throw an error. MySQL (no strict mode) Warning
...t use your production application in no strict mode. DON'T! MySQL will store the closest representable value. Here are some examples for a DECIMAL with a precision of...
...s query parsing and LIKE query functionality. Minidusen can no longer index text in MySQL FULLTEXT columns, which was hardly used and didn't always help performance due to the...
...cost of reindexing. Minidusen is currently compatible with MySQL, PostgreSQL, Rails 3.2, Rails 4.2 and Rails 5.0. Basic Usage Our example will be a simple address book: class Contact < ActiveRecord...
...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...
...that checks out a feature branch based on a story from Pivotal Tracker Faster MySQL dumping with --single-transaction and --quick Allow pivotal tracker ids in the global config file...
SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'your_database' order by table_rows;
...get this error message Couldn't create database for {"encoding"=>"utf8", "username"=>"root", "adapter"=>"mysql", "database"=>"project_development", "password"=>"topsecret"}, charset: utf8, collation: utf8_unicode_ci (if you set the...
...make sure the user you have specified (root/topsecret) in your database.yml has access to MySQL. You can check this by running mysql -uroot -p...
The next version of MySQL will include a built-in memcached daemon. This daemon can quickly get and set key/value pairs from and to InnoDB tables while completely bypassing the...
...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...
...and need to be sanitized. Unfortunately this works in SQLite but does not in MySQL: named_scope :filter, lambda { |attribute, value| { :conditions => [ 'articles.? = ?', attribute, value ] } } The solution is to use...
MariaDB (and MySQL) is released in different versions with different behaviors. For backwards compatibility this can be managed with the sql_mode option. Following you can find behavior differences which...
...data. Dumping single tables makes sense if a complete dump would be to big. mysqldump -u deploy_user -p application_production table1 table2 table2 > table1_table2_table2.sql.dump Hint: If a table has...
Further reading: How to load only a subset of a massive MySQL dump How to import production database dump to staging (or the other way...
You might have a table without a primary key set in MySQL. You can fix this by adding a primary key index to the guilty MySQL table, or by setting...
Possible Reason 1: parallel_tests - running more processes than features If you run old versions of parallel_tests with more...
...sum up columns with + in a sql-query if NULL-Values can be present. MySQL and PostgreSQL cannot sum up NULL values with the + value. The sum value will be...
MySQL: mysql> select 1 + 2 + 3; +-----------+ | 1 + 2 + 3 | +-----------+ | 6 | +-----------+ 1 row in set (0,00 sec) mysql> select 1 + NULL + 3; +--------------+ | 1 + NULL + 3 | +--------------+ | NULL | +--------------+
If you have many connections to your MySQL or MariaDB (as we have) you might want to filter the list you see when running a SHOW PROCESSLIST. To hide all...
There is an more advanced way by querying the information_schema database: Show MySQL process list without sleeping connections
If you upgrade to the mysql2 gem, you will run into the problem that the server's database.yml (which is usually not under version control) needs to change exactly on...
You can however make your database.yml work for mysql and mysql2 at the same time. Simpy do this production: adapter: <%= defined?(Mysql2) ? 'mysql2' : 'mysql...
This Perl script will run diagnostics on your MySQL database and recommend changes to your MySQL configuration...
For reasons that completely escape me, MySQL 5.x limits UTF-8 strings to U+FFFF and smaller...