Update WordPress author
Like me, many of you may have installed WordPress and begun using it as the default administrator account - admin.
The problem is, you'll later wish you'd created your own user account, which would have been tied in with each of your posts and comments. Up until 2 minutes ago, all my posts were created by admin and all comments written by me had the name admin assigned to them.
There are several options if you're in this scenario - including creating a new account and ensuring all future posts/comments use it or updating all existing records with your new account details. I opted for the 2nd option and began by working out what users were currently in the slickhouse WordPress database:
SELECT ID, user_login FROM wp_users
This will return a list of all IDs and user_logins from the wp_users table within the database. In my case, slickhouse has just the one user - admin. It's then a case of updating the user as necessary. Start by selecting all columns for the previously returned record (which had an ID of 1):
SELECT * FROM wp_users WHERE ID = 1
This returns all columns for the user admin in my case. From the results, I chose to update the following columns:
- user_login
- user_nicename
- display_name
- user_firstname
- user_lastname
- user_nickname
UPDATE wp_users SET user_login = 'example', display_name = 'example', user_firstname = 'example', user_lastname = 'example', user_nickname = 'example' WHERE ID = 1
Replace example with what you'd like each column to be updated to. As we've just updated the existing user, there's less work to do - the wp_posts table doesn't need to be touched, as it references the wp_users by the ID field, that hasn't changed. However, wp_comments is a different story and does need updating:
UPDATE wp_comments SET comment_author = 'Example', comment_author_email = 'example@example.com', comment_author_url = 'http://example.com' WHERE user_id = 1
This will update all comments that are associated with your admin account, to the new details. Replace example in the above with all of the information you updated the admin user to previously.
And that should be it! I carried out all of the above using the MySQL Query Browser, which can be downloaded from the MySQL site. One word of warning - ensure you've got a backup of your database prior to carrying out any of the above. Make a note of what you update, so that if you do run into difficulties you can update the records back to what they were originally - or if all else fails, restore from your backup. Again, a backup can be accomplished using the MySQL Administrator.
Posted: Monday 22nd December 2008, 17:53pm
Categories: Slickhouse, Web
Tags: mysql, sql, wordpress
New Hosting!
For the past 5 or so years, slickhouse.com has been hosted on a shared Linux server, provided by UKHost4U.
While the hosting has been good, I've grown out of using a shared web server and all of the limitations that go with it. So, over the past year I've developed my own dedicated web server, with a twist - a) it's Windows and b) it's hosted at slickhouse itself.
For those of you interested in running your own web server, it's actually a fairly straightforward, albeit time-consuming thing to do. And it proved successful - as you are reading this served up by the new server!
The hardware:
- AMD Athlon 3000XP (Barton core)
- 2 x 1GB PC3200 DDR
- MSI K7N2 consumer motherboard
- 4 x 250GB data drives, 1 x 120GB O/S drive
- Yeong Yang cube case
- Microsoft Server 2003 R2 w/SP2 (both host and virtual O/S)
- Virtual Server 2005 (1GB allocated RAM, 100% allocated CPU)
- PHP
- MySQL
- MySQL Administrator for a GUI w/MySQL
- ASP (and .NET)
- Filezilla Server for FTP
- Merak Mail Server
- AWStats for statistics
- Active Perl for AWStats
- IIS 6.0 for web
- GoDaddy for domain registration
- ZoneEdit.com for DNS (dynamic)
- DynDNS for DNS (dynamic)
- Google Mail to collate all of the email
- Smoothwall for router/firewall O/S
I chose to use Microsoft's Virtual Server 2005, as it allows me to run several operating systems on the same machine. Currently the server only has the host and virtual operating systems, but I'll be expanding it with a development server soon. Another advantage to going virtual, is that I can easily copy the whole server from one physical hardware platform to the next. So if a catastrophic failure occurs, I can quickly transfer the image of the server to another hard-drive, or Virtual Server.
This configuration has so far proved to be a lot more beneficial to my previous shared hosting solution with UKHost4U. For a start, I'm in complete control of the whole solution - from domain registration, to configuration of the server itself. Also, it means I'm not limited by the assigned disk space and bandwidth provided with my shared hosting package. My ISP at home is Virgin Media, who over the last week has upgraded me from 4MB/400KB Cable broadband, to 10MB/500KB - they still have an unlimited bandwidth policy too!
So what's required then? I'll start in order of what you see as a visitor:
- Domain registration - to get yourself a name on the 'net
- DNS - to point your domain to an IP address
- Dynamic DNS - to update your DNS with your dynamic IP address
- Firewall/Router - to block and route traffic around your LAN
- Web server (IIS 6.0) - to serve web pages
- Mail server (POP3/SMTP) - to send and receive email
- PHP/ASP - to server dynamic web pages
- MySQL - to provide database(s)
Let me know if you encounter any issues with the new hosting, as I've moved ~500MB from the Linux server across to the Windows server and have most likely missed something from my testing! If anyone is interested in having a site hosted on the new server, then get in touch - as a ZoneEdit account, along with a Domain of your choice is all you'll need. Uptime is currently 39 days and counting...
Posted: Monday 31st March 2008, 17:53pm
Categories: Articles, Computers and Technology, Slickhouse, Web
Tags: asp, dynamic-dns, ftp, hosting, merak, mysql, perl, php, virtual-server, web-server

Feeds
Twitter

