set names utf8; drop database if exists treny; create database treny default character set utf8 collate utf8_polish_ci; grant all on treny.* to redaktor@localhost identified by 'tajnehaslo'; flush privileges; use treny; CREATE TABLE IF NOT EXISTS `tren` ( `tren_id` int(11) NOT NULL AUTO_INCREMENT, `tytul` varchar(128) COLLATE utf8_polish_ci DEFAULT NULL, `tresc` text COLLATE utf8_polish_ci, `slug` varchar(128) COLLATE utf8_polish_ci DEFAULT NULL, `numer` int(11) DEFAULT NULL, PRIMARY KEY (`tren_id`), UNIQUE KEY `u_slug` (`slug`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci AUTO_INCREMENT=20 ; INSERT INTO `tren` (`tren_id`, `tytul`, `tresc`, `slug`, `numer`) VALUES (1, 'Tren I', 'Wszytki płacze...', 'tren_i', 1), (2, 'Tren X', 'Orszulo moja wdzięczna...', 'tren_x', 10), (3, 'Tren XVI', 'Nieszczęściu kwoli...', 'tren_xvi', 16);
Listing 13.9. Plik zrzut-bazy-danych.sql
Rozdział 13. Komponent menu