MediaWiki reinstallation notes >
Checking out Bundled server software — it works!
Using (distribution not recorded)
Cleanup ∞
I had to do some cleanup first:
pcc > system > services
XAMPP/Lite ∞
Doesn’t exist for Linux.
Old backup notes ∞
2008-09-07:
I had some issues and did some research on this.
First, figure out the charset of the live website’s database. You can see which character set your tables are using with a MySQL statement like:
mysql -u username -p username_mediawiki
SHOW CREATE TABLE text;
Try dumping like this.
USER=username PASSWORD=password CHARSET=utf8 DATABASE=username_mediawiki nice -n 19 mysqldump -u $USER -p$PASSWORD --default-character-set=$CHARSET $DATABASE -c | nice -n 19 gzip -9 > database.sql.gz
XAMPP ∞
(XAMPP)
stuff ∞
- https://www.apachefriends.org/download.html [ 1 ] was http://www.apachefriends.org/en/xampp-linux.html
su tar xvfz /home/user/Desktop/xampp-linux-1.6.7.tar.gz -C /opt /opt/lampp/lampp start
Spoiler
Starting XAMPP for Linux 1.6.7... XAMPP: Starting Apache with SSL (and PHP5)... XAMPP: Starting MySQL... XAMPP: Starting ProFTPD... XAMPP for Linux started.
Then run:
/opt/lampp/lampp security
And do this:
XAMPP: Quick security check... XAMPP: Your XAMPP pages are NOT secured by a password. XAMPP: Do you want to set a password? [yes] no XAMPP: MySQL is accessable via network. XAMPP: Normaly that's not recommended. Do you want me to turn it off? [yes] yes XAMPP: Turned off. XAMPP: Stopping MySQL... XAMPP: Starting MySQL... XAMPP: The MySQL/phpMyAdmin user pma has no password set!!! XAMPP: Do you want to set a password? [yes] no XAMPP: MySQL has no root passwort set!!! XAMPP: Do you want to set a password? [yes] no XAMPP: The FTP password is still set to 'lampp'. XAMPP: Do you want to change the password? [yes] no XAMPP: Done.
Ok, done.
/opt/lampp/lampp stopftp
Is everything healthy?
/opt/lampp/lampp status
Spoiler
Version: XAMPP for Linux 1.6.7 Apache is running. MySQL is running. ProFTPD is deactivated.
-
Then surf to
http://localhost -
surf to
http://localhost/xampp/lang.php?en- .. everything looks healthy
http://localhost/phpmyadmin/- On that same page, in the middle, for “Create new database” and type in
username_mediawiki - At the top tab, click ‘import’
- Browse for the SQL file
-
Character set of the file: latin1
It says:
Error
You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.
Sigh.
Ok, at the commandline
/opt/lampp/bin/mysql source /mnt/cdrom/filename.sql
It explodes with a whole lot of:
ERROR 1046 (3D000): No database selected
So I do a control-c
/opt/lampp/bin/mysql
USE username_mediawiki source /mnt/cdrom/filename.sql
It seems to be trying very hard now. I got some errors that flew by, about some tables which did not exist. I don’t understand how that’s possible since I did a regular everyday dump of this database.
note to self: I probably could have skipped using PhpMyAdmin entirely and used a commandline for MySQL:
DROP database username_mediawiki; CREATE database username_mediawiki;
Making a user:
CREATE USER username IDENTIFIED BY 'password';
FYI, to change that password later, do this:
SET PASSWORD FOR 'username'@'%' = PASSWORD('password');
ok, now control-d to get out of MySQL.
Restore the httpdocs from your old server, to the root of /opt/lampp/htdocs/
Make sure that you also get any hidden files. The most common one will be your .httpdocs
If you vist localhost and you get:
Sorry! This site is experiencing technical difficulties. Try waiting a few minutes and reloading. (Can't contact the database server: Access denied for user 'username'@'localhost' (using password: YES) (localhost))
/opt/lampp/bin/mysql
SET PASSWORD FOR 'username'@'%' = PASSWORD('password');
This failed for me. Hmm. I checked LocalSettings.php and everything seemed healthy. Maybe it’s a permissions issue?
chown nobody /opt/lampp/htdocs/ -R
Nope..
It’s because XAMPP is stupidly redirecting http://localhost/ to http://localhost/xampp/
I deleted /opt/lampp/htdocs/index.html and I refreshed the page. Now I stay at http://localhost/ and still get the same “can’t connect” error. So the issue must be with the user or database.
So let’s see if you can get in with:
/opt/lampp/bin/mysql --user username
Nope.
/opt/lampp/bin/mysql --user root
Pressed enter for the password. It lets me in.
SET PASSWORD FOR 'username'@'%' = PASSWORD('password'); # press control-d to exit
/opt/lampp/bin/mysql --user username
Nope.
/opt/lampp/bin/mysql --user username
And pressing enter for the password. It lets me in. What the hell.
Ok, I’ll update htdocs/LocalSettings.php and htdocs/AdminSettings.php and blank out the password. It doesn’t work, now I get:
(Can't contact the database server: Access denied for user ''@'localhost' to database 'username_mediawiki' (localhost))
Ok, I switch things back. Now for something different. It looks like the user “username” doesn’t have permission to access the database “username_mediawiki”
/opt/lampp/bin/mysql --user username -p username_mediawiki
Gives me:
ERROR 1045 (28000): Access denied for user 'username'@'localhost' (using password: YES)
/opt/lampp/bin/mysql --user root -p username_mediawiki
GRANT ALL ON username_mediawiki.* TO 'username'@'localhost' identified by 'password';
Ok, now try:
/opt/lampp/bin/mysql --user username -p username_mediawiki
Wooh! Now try http://localhost but I get a new error!
A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query hidden) from within function "Job::pop". MySQL returned error "1146: Table 'username_mediawiki.job' doesn't exist (localhost)".
Ok, so let’s drop and re-import this database.
/opt/lampp/bin/mysql --user root -p username_mediawiki
DROP database username_mediawiki; CREATE database username_mediawiki; GRANT ALL ON username_mediawiki.* TO 'username'@'localhost' identified by 'password';
The exit, and let’s use MySQL to import things properly again.
/opt/lampp/bin/mysql -u username -p username_mediawiki < database.sql
I get an error, similar to the PhpMyAdmin error!
ERROR 1071 (42000) at line 178: Specified key was too long; max key length is 1000 bytes
So at this point I must conclude that my initial mysqldump command to make this .sql was bad!
I don’t see any way to dump things differently. Let’s try this.
/opt/lampp/bin/mysql --user root -p username_mediawiki
DROP database username_mediawiki; CREATE database username_mediawiki; GRANT ALL ON username_mediawiki.* TO 'username'@'localhost' identified by 'password'; USE username_mediawiki; ##### ALTER DATABASE DEFAULT CHARACTER SET latin1 COLLATE latin1_bin; source /opt/lampp/htdocs/database.sql
A lot of crap whizzes by. Ok, doing some checking it looks like update.php might need to be run..
/opt/lampp/bin/php /opt/lampp/htdocs/maintenance/update.php
Success! Now all I’d need to do is thin out these instructions into a working set.
- notes:
- The MySQL administrator (root) has no password.
- ProFTPD uses the password “lampp” for user “nobody”.
Footnotes

ported