tags:

views:

28

answers:

1

Hi,

I have to move a database from sql server to mySql, and our current db uses schemas as namespace.

So all of the FOO tables can be reference like FOO.TableFoo1, FOO.TAbleFoo2, FOO.TableF003, etc.

Can we do this with MySql? Will it work.

A: 

Yes in mysql you can have many schema, select the schema you want to use with the USE command or the mysql_select_db() API. You can also do cross-schema queries, as in

SELECT * FROM `FOO`.`TABLEFOO1`, `BAR`.`TABLEBAR1` WHERE ...

You create and delete schema using CREATE DATABASE FOO and DROP DATABASE BAR.

ggiroux
I think the MySQL term for those is simply "Database": http://dev.mysql.com/doc/refman/5.0/en/use.html
Joachim Sauer
Thanks! Got mixed up with the vocabulary :)
Hugo Estrada