Bug 1194611 - the 'test' database is no longer provided by default
Summary: the 'test' database is no longer provided by default
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Software Collections
Classification: Red Hat
Component: mysql
Version: rh-mysql56
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 2.0
Assignee: Honza Horak
QA Contact: Karel Volný
URL:
Whiteboard:
Depends On:
Blocks: 1200147
TreeView+ depends on / blocked
 
Reported: 2015-02-20 11:13 UTC by Karel Volný
Modified: 2015-06-04 08:44 UTC (History)
2 users (show)

Fixed In Version: rh-mysql56-mysql-5.6.23-6.el6, rh-mysql56-mysql-5.6.23-6.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1200147 (view as bug list)
Environment:
Last Closed: 2015-06-04 08:44:48 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2015:1059 normal SHIPPED_LIVE new packages: rh-mysql56 2015-06-04 12:43:36 UTC

Description Karel Volný 2015-02-20 11:13:41 UTC
Description of problem:
mysql-server used to provide a database named 'test' by default, which could have been used for mysql client that required a database name to be specified but didn't manipulate any data
in rh-mysql56, the 'test' database is no longer created by default, breaking everything that relied on its existence

Version-Release number of selected component (if applicable):
rh-mysql56-mysql-5.6.23-2.el6
rh-mysql56-mysql-5.6.23-2.el7

How reproducible:
always

Steps to Reproduce:
1. have a clean system, install rh-mysql56
2. scl enable rh-mysql56 bash
3. service rh-mysql56-mysqld start
4. mysql -e "SELECT 1+1;" test

Actual results:
ERROR 1049 (42000): Unknown database 'test'

Expected results:
+-----+
| 1+1 |
+-----+
|   2 |
+-----+


Additional info:
on RHEL6, the startup messages say:

...
Alternatively you can run:

  /opt/rh/rh-mysql56/root/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.
...

which suggests that 'test' should be present (otherwise there would be nothing to remove)

Comment 2 Honza Horak 2015-02-20 14:59:10 UTC
I've found no documentation so far why the test database was removed, if that was some security reason or whatever else or just mistake. Anyway, I don't plan to add `test` db creation downstream, so I'd rather fix the tests to ensure the database is created.

Comment 4 Karel Volný 2015-02-20 17:13:01 UTC
(In reply to Honza Horak from comment #2)
> so I'd rather fix the tests to ensure the database is created.

so far, I've found twenty tests affected and counting ...

which is the smaller problem, I can hack the library to create the database after starting mysql

what is worse is that our tests are probably not the only place where 'test' is used as a database name which is always present - I've seen it in some bug reproducers from customers too

but we can leave it missing and see who will complain :-)

in that case, I guess this is something that would deserve to be well documented ...

Comment 5 Karel Volný 2015-02-24 14:32:44 UTC
(In reply to Karel Volný from comment #4)
> what is worse is that our tests are probably not the only place where 'test'
> is used as a database name which is always present

and not just our tests - even mysql's own tests from rh-mysql56-mysql-bench fail due to this:

:: [  BEGIN   ] :: Running 'pushd /opt/rh/rh-mysql56/root/usr/share/sql-bench'
/opt/rh/rh-mysql56/root/usr/share/sql-bench /tmp/tmp.g9UvOdAxzO /mnt/tests/CoreOS/mysql/Sanity/benchmark
:: [   PASS   ] :: Command 'pushd /opt/rh/rh-mysql56/root/usr/share/sql-bench' (Expected 0, got 0)
:: [  BEGIN   ] :: Running './run-all-tests --server=mysql --log'
Got error: 'Unknown database 'test'' when connecting to DBI:mysql:database=test;host=localhost with user: '' password: ''
:: [   FAIL   ] :: Command './run-all-tests --server=mysql --log' (Expected 0, got 255)

Comment 6 Honza Horak 2015-03-09 20:30:51 UTC
So, I've checked this change with upstream and the `test` db is removed in upstream (since 5.7) from default installation, being it considered a security issue. Thus, the tests should create the `test` database if they use it.

Comment 7 Karel Volný 2015-03-11 13:23:25 UTC
(In reply to Honza Horak from comment #6)
> So, I've checked this change with upstream and the `test` db is removed in
> upstream (since 5.7) from default installation, being it considered a
> security issue.

ok, so let's document it

> Thus, the tests should create the `test` database if they use it.

I hope you mean also when used by software from mysql packages (comment #5) which you are going to fix as well as the message or maybe the whole mysql_secure_installation thingy mentioned in the bug description :-)

Comment 14 errata-xmlrpc 2015-06-04 08:44:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2015-1059.html


Note You need to log in before you can comment on or make changes to this bug.