Comments on: How to change the default database in MySQL http://www.xaprb.com/blog/2008/10/11/how-to-change-the-default-database-in-mysql/ Stay curious! Thu, 02 May 2013 12:36:53 +0000 hourly 1 http://wordpress.org/?v=3.5.1 By: Xaprb http://www.xaprb.com/blog/2008/10/11/how-to-change-the-default-database-in-mysql/#comment-15216 Xaprb Sun, 12 Oct 2008 12:43:11 +0000 http://www.xaprb.com/blog/?p=604#comment-15216 Shantanu, that’s a trick I also use sometimes to help me figure out which table a column comes from. Developers think it’s obvious, but when you’re a consultant it’s tough to optimize queries when you don’t know the schema by heart!

]]>
By: Shantanu Oak http://www.xaprb.com/blog/2008/10/11/how-to-change-the-default-database-in-mysql/#comment-15215 Shantanu Oak Sun, 12 Oct 2008 10:43:03 +0000 http://www.xaprb.com/blog/?p=604#comment-15215 >> all table names in the query are fully qualified so there’s no ambiguity
If that is all you are looking for, then “explain extended” and then show warnings will let you know the ‘database.table’ used by MySQL

]]>
By: Mikael Fridh http://www.xaprb.com/blog/2008/10/11/how-to-change-the-default-database-in-mysql/#comment-15214 Mikael Fridh Sun, 12 Oct 2008 08:42:33 +0000 http://www.xaprb.com/blog/?p=604#comment-15214 \r

]]>
By: Eric Day http://www.xaprb.com/blog/2008/10/11/how-to-change-the-default-database-in-mysql/#comment-15213 Eric Day Sun, 12 Oct 2008 06:54:23 +0000 http://www.xaprb.com/blog/?p=604#comment-15213 I just tested select_db() with an empty DB name, which issues a COM_DB_INIT at the protocol layer, and it doesn’t work. It sends the “correct” packet, with a 0 length DB, but you get back an error: “No database selected”. I suppose a bug/feature request could be filed to change the behavior of this request. :)

]]>
By: Dmitry Lenev http://www.xaprb.com/blog/2008/10/11/how-to-change-the-default-database-in-mysql/#comment-15212 Dmitry Lenev Sun, 12 Oct 2008 06:10:23 +0000 http://www.xaprb.com/blog/?p=604#comment-15212 MySQL test suite sometimes uses approach described by Brian. In other cases it uses special option for mysqltest’s “connect” command (indeed, it is probably not an approach that can be used in your case).

]]>