[ madcama @ 04.03.2009. 18:59 ] @
Zanima me kako da promenim ime baze.

Koristim 5.1.31-community verziju mysql-a.

U obzir dolaze sve varijante.

Naisao sam na par uputstava koja se svode na:
Code:
RENAME {DATABASE | SCHEMA} db_name TO new_db_name;
, ali ili ja ne znam kako se to koristi ili to ne radi.

Uvek dobijam poruku o gresci
Citat:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{DATABASE | SCHEMA} mad TO mad1' at line 1
ili krace Error Nr. 1064.


Gde gresim?
[ misk0 @ 04.03.2009. 20:02 ] @
A nisi napisao kako si ti oblikvao komandu tj sta si napisaoi?
[ madcama @ 04.03.2009. 21:09 ] @
Probao sam i rename database mad to mad1 i rename scheme mad to mad1
[ bogdan.kecman @ 05.03.2009. 01:28 ] @
http://dev.mysql.com/doc/refman/5.1/en/rename-database.html
Citat:

This statement was added in MySQL 5.1.7 but was found to be dangerous and was removed in MySQL 5.1.23. It was intended to enable upgrading pre-5.1 databases to use the encoding implemented in 5.1 for mapping database names to database directory names (see Section 8.2.3, “Mapping of Identifiers to File Names”). However, use of this statement could result in loss of database contents, which is why it was removed. Do not use RENAME DATABASE in earlier versions in which it is present.


Dakle, ukratko, NEMOJ DA KORISTIS RENAME DATABASE!!!

Najlaksi nacin je da samo promenis ime direktorijumu u datadir direktorijumu - to zahteva shutdown / start
Drugi nacin je da kreiras novu bazu i onda odradis rename tabela iz jedne u drugu bazu .. ovde imas limit da obe baze moraju da su na istom fajl sistemu