2019-12-31, 23:39
I have the add-on WatchedList on three different platforms. I read the forum on the topic of moving the local database to an sql server and I have an sql server up and running and followed the directions in the post https://kodi.wiki/view/Add-on:WatchedList. Everything was going well but during the section of replacing the syntax in the exported database to sql, nothing gets changed.
So I thought I would just export the database without the data so I could at least have the structure imported into my sql database. But when trying to import it, I get an error message "MySQL said:
#1064 - 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 'TRANSACTION' at line 1"
Here it the database I am trying to import as listed in Notepad++. Can anyone advise me on what I could do to make this work? I know in Kodi if you setup the advancedsettings it will automatically create the database in SQL. But I am opting not to move my database to it at this point, just the data from WatchedList.
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "tvshows" (
"idShow" INTEGER,
"title" TEXT,
PRIMARY KEY("idShow")
);
CREATE TABLE IF NOT EXISTS "episode_watched" (
"idShow" INTEGER,
"season" INTEGER,
"episode" INTEGER,
"playCount" INTEGER,
"lastChange" INTEGER,
"lastPlayed" INTEGER,
PRIMARY KEY("idShow","season","episode")
);
CREATE TABLE IF NOT EXISTS "movie_watched" (
"idMovieImdb" INTEGER,
"playCount" INTEGER,
"lastChange" INTEGER,
"lastPlayed" INTEGER,
"title" TEXT,
PRIMARY KEY("idMovieImdb")
);
COMMIT;
So I thought I would just export the database without the data so I could at least have the structure imported into my sql database. But when trying to import it, I get an error message "MySQL said:
#1064 - 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 'TRANSACTION' at line 1"
Here it the database I am trying to import as listed in Notepad++. Can anyone advise me on what I could do to make this work? I know in Kodi if you setup the advancedsettings it will automatically create the database in SQL. But I am opting not to move my database to it at this point, just the data from WatchedList.
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "tvshows" (
"idShow" INTEGER,
"title" TEXT,
PRIMARY KEY("idShow")
);
CREATE TABLE IF NOT EXISTS "episode_watched" (
"idShow" INTEGER,
"season" INTEGER,
"episode" INTEGER,
"playCount" INTEGER,
"lastChange" INTEGER,
"lastPlayed" INTEGER,
PRIMARY KEY("idShow","season","episode")
);
CREATE TABLE IF NOT EXISTS "movie_watched" (
"idMovieImdb" INTEGER,
"playCount" INTEGER,
"lastChange" INTEGER,
"lastPlayed" INTEGER,
"title" TEXT,
PRIMARY KEY("idMovieImdb")
);
COMMIT;