Afficher un message
Vieux 13/02/2008, 18h21   #10
Axel Schwenke
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mysqldump and VIEW definitions

lawpoop@gmail.com wrote:

> mysqldump -uuser -p - --skip-opt --all --complete-insert
> original_database > ./original_database_backup.sql

....

> mysql> \. original_database_backup.sql
>
> Query OK, 0 rows affected (0.06 sec)
> Query OK, 0 rows affected (0.06 sec)
> ...
> Query OK, 0 rows affected (0.06 sec)
> ERROR 1050 (42S01): Table 'vCardQuestionsNested' already exists
> ERROR 1050 (42S01): Table 'vClientLocationCodeDates' already exists
> ERROR 1050 (42S01): Table 'vClientLocationQuestions' already exists
> ERROR 1050 (42S01): Table 'vClientLocationQuestionsNested' already
> exists
> ERROR 1050 (42S01): Table 'vClientQuestionsNested' already exists
> ERROR 1050 (42S01): Table 'vHistoricalStoreScores' already exists



Those error messages look fishy. What version of mysql / mysqldump /
server are you using? Are you superuser when you load the dump?
The above could happen if you don't have the DROP privilege.


Here is how it should look:

~ $mysql test

mysql> create table t1 (c1 int);
Query OK, 0 rows affected (0,08 sec)

mysql> create view v1 as select * from t1;
Query OK, 0 rows affected (0,00 sec)

mysql> Bye

~ $mysqldump --skip-comments --skip-opt --complete-insert test
-- PROLOGUE
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `t1` (
`c1` int(11) default NULL
);
SET character_set_client = @saved_cs_client;

/*!50001 CREATE TABLE `v1` (
`c1` int(11)
) */;
/*!50001 DROP TABLE `v1`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v1` AS select `t1`.`c1` AS `c1` from `t1` */;
-- EPILOGUE


Can you try what you get for the above example?


XL
--
Axel Schwenke, Support Engineer, MySQL AB

Online User Manual: http://dev.mysql.com/doc/refman/5.0/en/
MySQL User Forums: http://forums.mysql.com/
  Réponse avec citation
 
Page generated in 0,08481 seconds with 9 queries