As you know I’m a bit of a wordpress geek, and have been building a company Intranet with a wordpress install. During all of the fun and games with the Sophos software upgrade (see http://www.rikzblog.862be1ab23b235a0bfbae2321-17362.sites.k-hosting.co.uk/?p=169) the intranet database has become corrupt and needs to be recreated. I’m hoping I can recover everything from the original folders, we’ll see…
First step was to recreate an instance of the database, I’ve been using MySQL, first off (unless you have a path entry) open a command prompt and navigate to the bin folder of your MySQL installation, the follow the instructions (from the WP codex) below;
$ mysql -u adminusername -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5340 to server version: 3.23.54
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE DATABASE databasename;
Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON databasename.* TO "wordpressusername"@"hostname"
-> IDENTIFIED BY "password";
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
mysql> EXIT
Bye
$
That will create your database instance. Be sure to get all of the semi-colons in the right place and of course, remember to record details of your admin username and password!
My next task is to try to restore the WordPress installation and the SQL database from backups, wish me luck!
(Update)
Ah, that’s not going to happen it would seem, the SQL database backup appears to contain an empty database, so we’ll have to start from scratch. Damn…
1 thought on “Windows, WordPress and MySQL”