Forum Moderators: coopster
Path? No, not really. MySQL creates each database in a directory of it's own and the tables created in that database reside within that directory.
What version of MySQL are you running? As of MySQL 4.0.2, your users may see only those databases for which they have some kind of privilege, but that's only if they don't have the global SHOW DATABASES [dev.mysql.com] privilege.
Otherwise, you can specify a pattern:
SHOW DATABASES [LIKE 'pattern']
Lastly, you do have one other option, but it is based on you controlling the display of the tables via a PHP script. You could load an array with your table names that you don't want them to see, then during a php loop, compare the current table in your result set to see if it is in_array() [php.net] and if it is, don't display that particular table. This would obviously require you to maintain an array every time you added a new table, though.
<pre>
<?php
$do_not_show = array('topsecret', 'patents', 'payroll');
$rows = mysql_query("SHOW DATABASES");
while ($row = mysql_fetch_assoc($rows)) {
if (!in_array($row['Database'], $do_not_show)) print $row['Database'] . "\n";
}
?>
</pre>