Обсуждение: Moving from Mysql

Поиск
Список
Период
Сортировка

Moving from Mysql

От
Luis Daniel Lucio Quiroz
Дата:
Hi,

Well, i'm moving some databases from Mysql to Pgsql, but i'm having some admin
doubts, i wondering 3 things:
1. whar are equivalent for these commands:
in mysql:  mysqldump mydata_base_name
mysql mydata_base_name < script.sql

2. any link to read about how to admin pgsql with mysql backgraounds,
3. how users are managed in pgsql, i need to create a specifiq username for db,
but how?

TIA

LD

Re: Moving from Mysql

От
Stephen Frost
Дата:
* Luis Daniel Lucio Quiroz (luis.daniel.lucio@gmail.com) wrote:
> 1. whar are equivalent for these commands:
> in mysql:  mysqldump mydata_base_name

pg_dump (pg_restore to restore from the dump, if you use a non-SQL
format for it, which can give you the ability to do a parallel-restore)

> mysql mydata_base_name < script.sql

psql

> 2. any link to read about how to admin pgsql with mysql backgraounds,

The PG documentation is really quite good:
http://www.postgresql.org/docs/8.4/

> 3. how users are managed in pgsql, i need to create a specifiq username for db,
> but how?

PG Roles (users and groups) are managed on a per-cluster level.  There
isn't a really good way to do them at a per-database level today.
A cluster in PG is a full PG instance and a single cluster contains
multiple databases.  You can manage which databases users are allowed to
connect to though, check out the GRANT command.

    Thanks,

        Stephen

Вложения

Re: Moving from Mysql

От
David Fetter
Дата:
On Sat, May 22, 2010 at 11:06:02PM -0400, Stephen Frost wrote:
> * Luis Daniel Lucio Quiroz (luis.daniel.lucio@gmail.com) wrote:
> > 1. whar are equivalent for these commands:
> > in mysql:  mysqldump mydata_base_name
>
> pg_dump (pg_restore to restore from the dump, if you use a non-SQL
> format for it, which can give you the ability to do a parallel-restore)

The way to call pg_dump so it goes to the most flexible format in
pg_dump -Fc.  You can find out more about this format in the man page,
if you're using a unix-like system, or in the on-line docs:

http://www.postgresql.org/docs/current/static/app-pgdump.html

> > mysql mydata_base_name < script.sql
>
> psql

With the output of pg_dump -Fc, you'll be using pg_restore, which is
more complex, but much more flexible.

http://www.postgresql.org/docs/current/static/app-pgrestore.html

> > 2. any link to read about how to admin pgsql with mysql backgraounds,
>
> The PG documentation is really quite good:
> http://www.postgresql.org/docs/8.4/

Here are a few more specific ones, some of which may apply to your
situation:

http://sql-info.de/mysql/gotchas.html
http://www.raditha.com/mysql/mysql2pgsql.php
http://www.in-nomine.org/~asmodai/mysql-to-pgsql.html
http://blog.gtuhl.com/2010/04/15/not-a-fan-of-mysql/
http://pgfoundry.org/projects/mysql2pgsql/
http://search.cpan.org/search?query=SQL%3A%3ATranslator&mode=all
http://www.metatrontech.com/wpapers/mysql2postgresql.pdf
http://www.data-conversions.net/products.php?prod_num=5&&dest=MENU&&ID=200
http://pgfoundry.org/projects/mysqlcompat

> > 3. how users are managed in pgsql, i need to create a specifiq username for db,
> > but how?
>
> PG Roles (users and groups) are managed on a per-cluster level.  There
> isn't a really good way to do them at a per-database level today.
> A cluster in PG is a full PG instance and a single cluster contains
> multiple databases.  You can manage which databases users are allowed to
> connect to though, check out the GRANT command.

Also check out host-based authentication, which you control with an
external file called pg_hba.conf:

http://www.postgresql.org/docs/current/static/client-authentication.html

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate