1Wiki::Toolkit::Setup::MUysSeQrL(C3o)ntributed Perl DocumWeinktia:t:iToonolkit::Setup::MySQL(3)
2
3
4
6 Wiki::Toolkit::Setup::MySQL - Set up tables for a Wiki::Toolkit store
7 in a MySQL database.
8
10 use Wiki::Toolkit::Setup::MySQL;
11 Wiki::Toolkit::Setup::MySQL::setup($dbname, $dbuser, $dbpass, $dbhost);
12
13 Omit $dbhost if the database is local.
14
16 Set up a MySQL database for use as a Wiki::Toolkit store.
17
19 setup
20 use Wiki::Toolkit::Setup::MySQL;
21 Wiki::Toolkit::Setup::MySQL::setup($dbname, $dbuser, $dbpass, $dbhost);
22
23 or
24
25 Wiki::Toolkit::Setup::Mysql::setup( $dbh );
26
27 You can either provide an active database handle $dbh or connection
28 parameters.
29
30 If you provide connection parameters the following arguments are
31 mandatory -- the database name, the username and the password. The
32 username must be able to create and drop tables in the database.
33
34 The $dbhost argument is optional -- omit it if the database is
35 local.
36
37 NOTE: If a table that the module wants to create already exists,
38 "setup" will leave it alone. This means that you can safely run
39 this on an existing Wiki::Toolkit database to bring the schema up
40 to date with the current Wiki::Toolkit version. If you wish to
41 completely start again with a fresh database, run "cleardb" first.
42
43 cleardb
44 use Wiki::Toolkit::Setup::MySQL;
45
46 # Clear out all Wiki::Toolkit tables from the database.
47 Wiki::Toolkit::Setup::MySQL::cleardb($dbname, $dbuser, $dbpass, $dbhost);
48
49 or
50
51 Wiki::Toolkit::Setup::Mysql::cleardb( $dbh );
52
53 You can either provide an active database handle $dbh or connection
54 parameters.
55
56 If you provide connection parameters the following arguments are
57 mandatory -- the database name, the username and the password. The
58 username must be able to drop tables in the database.
59
60 The $dbhost argument is optional -- omit if the database is local.
61
62 Clears out all Wiki::Toolkit store tables from the database. NOTE
63 that this will lose all your data; you probably only want to use
64 this for testing purposes or if you really screwed up somewhere.
65 Note also that it doesn't touch any Wiki::Toolkit search backend
66 tables; if you have any of those in the same or a different
67 database see either Wiki::Toolkit::Setup::DBIxFTS or
68 Wiki::Toolkit::Setup::SII, depending on which search backend you're
69 using.
70
72 As requested by Podmaster. Instead of passing arguments to the methods
73 as
74
75 ($dbname, $dbuser, $dbpass, $dbhost)
76
77 you can pass them as
78
79 ( { dbname => $dbname,
80 dbuser => $dbuser,
81 dbpass => $dbpass,
82 dbhost => $dbhost
83 }
84 )
85
86 or indeed as
87
88 ( { dbh => $dbh } )
89
90 Note that's a hashref, not a hash.
91
93 Kake Pugh (kake@earth.li).
94
96 Copyright (C) 2002-2004 Kake Pugh. All Rights Reserved.
97 Copyright (C) 2006-2008 the Wiki::Toolkit team. All Rights Reserved.
98
99 This module is free software; you can redistribute it and/or modify it
100 under the same terms as Perl itself.
101
103 Wiki::Toolkit, Wiki::Toolkit::Setup::DBIxMySQL,
104 Wiki::Toolkit::Setup::SII
105
106
107
108perl v5.30.0 2019-07-26 Wiki::Toolkit::Setup::MySQL(3)