-
Notifications
You must be signed in to change notification settings - Fork 7
File wikt_parsed_empty_sql
This guide helps to create, edit and load empty Wiktionary parsed database into MySQL (see /wikt_parser/doc).
This step should be done before the parsing of the Wiktionary database (see Getting started Wiktionary parser).
mysql$ CREATE DATABASE enwikt20100824_parsed;
mysql$ USE enwikt20100824_parsed
mysql$ SOURCE /data/all/projects/git/wikokit/wikt_parser/doc/wikt_parsed_empty.sql
mysql$ GRANT SELECT ON enwikt20100824.* TO javawiki@'%';
mysql$ GRANT ALL ON enwikt20100824_parsed.* TO javawiki@'%';
mysql$ FLUSH PRIVILEGES;
If MySQL whines and prints error message that access is denied then you can try use "localhost" instead of "%":
mysql$ GRANT SELECT ON enwikt20100824.* TO javawiki@'localhost';
You can list the privileges that are granted to a MySQL user account ('javawiki'):
mysql$ SHOW GRANTS FOR javawiki;
- Edit
wikt_parsed_empty.mwb
file in MySQL Workbench, export it towikt_parsed_empty.sql
- Make substitution in
wikt_parsed_empty.sql
in VIM by RE:
%s/`mydb`\.//g
- Create DB in MySQL, e.g.
ruwikt20090122_parsed
USE ruwikt20090122_parsed
SOURCE wikt_parsed_empty.sql
The structure (tables and relations) of the Wiktionary parsed database (database layout, see the file wikt_parsed_empty_with_foreign_keys.png):
Set of tables related to quotations (fragment of the Wiktionary parsed database):
CREATE TABLE test (id INT, INDEX(id));
ALTER TABLE relation
DROP INDEX idx_software_key
,
ADD INDEX idx_software_key
( software_key
( 3 ) );
Table image
. Field filename
, index UNIQUE
, to constrain the length: 255.
Table label
. Field short_name
, index INDEX
, to constrain the length: 255.
- Setup NetBeans for parsing ‒ Setup NetBeans environment for parsing, run parser
- MySQL import ‒ Import Wiktionary database into local MySQL database
- MySQL Workbench ‒ How to create empty SQL file for the Wiktionary parsed database.