Делаю запрос для создания таблиц
CREATE TABLE IF NOT EXISTS `albums` (
`album_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`album_name` varchar(40) NOT NULL,
`album_date` date DEFAULT NULL,
`artist_id` int(10) UNSIGNED DEFAULT NULL,
PRIMARY KEY (`album_id`),
KEY `artist_id` (`artist_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `artists` (
`artist_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`artist_name` varchar(40) NOT NULL,
PRIMARY KEY (`artist_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `genres` (
`genre_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`genre_name` varchar(40) NOT NULL,
PRIMARY KEY (`genre_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `styles` (
`style_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`style_name` varchar(40) NOT NULL,
PRIMARY KEY (`style_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `tracks` (
`track_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`track_patch` text NOT NULL,
`track_time` time DEFAULT NULL,
`track_name` varchar(40) NOT NULL,
`style_id` int(10) UNSIGNED DEFAULT NULL,
`genre_id` int(10) UNSIGNED DEFAULT NULL,
`album_id` int(10) UNSIGNED NOT NULL,
PRIMARY KEY (`track_id`),
KEY `album_id` (`album_id`),
KEY `style_id` (`style_id`),
KEY `genre_id` (`genre_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `users` (
`user_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`login` varchar(40) NOT NULL,
`password` varchar(40) NOT NULL,
`registration_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
ALTER TABLE `albums`
ADD CONSTRAINT `FK_albums_artist_id` FOREIGN KEY (`artist_id`) REFERENCES `artists` (`artist_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `tracks`
ADD CONSTRAINT `FK_tracks_album_id` FOREIGN KEY (`album_id`) REFERENCES `albums` (`album_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_tracks_style_id` FOREIGN KEY (`style_id`) REFERENCES `styles` (`style_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_tracks_genre_id` FOREIGN KEY (`genre_id`) REFERENCES `genres` (`genre_id`) ON DELETE CASCADE ON UPDATE CASCADE;
При выполнении MySQL выдает
# MySQL вернула пустой результат, хотя на самом деле таблицы создаются
В чем может быть проблема?