Install wordpress on CentOS 5.2
Posted by Martin Perron on Jan 27, 2009 in HowTo - Linux • 27 commentsWordPress is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability. WordPress is both free and priceless at the same time. (http://wordpress.org/)
First, you need to create a user and empty database.
On a default settings, mysql root user do not need a password to authenticate from localhost. In this case, ou can login as root on your mysql server using:
mysql -u root
If a password is required, use the extra switch -p:
mysql -u root -p
Enter password:
Now that you are logged in, we create a database:
mysql> create database wordpress;
Query OK, 1 row affected (0.00 sec)
We allow user wordpress to connect to the server from localhost using the password wordpress:
mysql> grant usage on *.* to wordpress@localhost identified by ‘wordpress’;
Query OK, 0 rows affected (0.00 sec)
And finally we grant all privileges on the wordpress database to this user:
mysql> grant all privileges on wordpress.* to wordpress@localhost ;
Query OK, 0 rows affected (0.00 sec)
Now that we have our database and user, we will download wordpress: (http://wordpress.org/download/)
cd /var/www/html
wget http://wordpress.org/latest.zip (If you dont have wget: yum install wget)
unzip latest.zip
cp wp-config-sample.php wp-config.php
vi wp-config.php
You need to add database name, user name and password
define(’DB_NAME’, ‘wordpress’);
/** MySQL database username */
define(’DB_USER’, ‘wordpress’);/** MySQL database password */
define(’DB_PASSWORD’, ‘wordpress’);
Save and now open your web browser to this address:
http://IpOfTheServer/wp-admin/install.php
That’s it! WordPress should now be installed.
Creating Database and user for mysql reference: http://www.debuntu.org/how-to-create-a-mysql-database-and-set-privileges-to-a-user
5 mins install reference: http://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install

Hi
I am getting a bit tires here. I’ve been trying for the last 4 hours to install WP.
I am on CEntOs5.
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.
* Are you sure you have the correct username and password?
* Are you sure that you have typed the correct hostname?
* Are you sure that the database server is running?
CAn someone please gimme a hand?
Thanks in advance
If you have problem with the command line for creating the MySQL DB, user and permission, you should consider installing phpmyadmin. There you will be able to create a user with is database and permission in one click!
Try installing rpgforge repos and phpmyadmin:
http://geekzine.org/2008/10/28/install-centos-52-as-a-server-lampbindntp/
I am not new to Linux but I will try PhpMyadmin
Thank you for you kind help!
Marty
I didnt think that you were new. I always create user and database throught phpmyadmin. It’s so simple that way
I can’t get wordpress themes to work from the internet. They show up fine locally. I tried googling to find the answer. It also won’t show my images globally!!
maybe you got a permission problem.
try to reset the theme folder permissions to the apache user:
On CentOS, apache user is apache:
chown -Rf apache:apache thethemefolder
chmod -Rf 755 thethemefolder
[...] Install wordpress on CentOS 5 2 Geekzine org Posted by root 1 hour 2 minutes ago (http://geekzine.org) Jan 27 2009 and finally we grant all privileges on the wordpress database to error establishing a database connection leave a comment name required articles rss comments rss powered by wordpress theme by Discuss | Bury | News | Install wordpress on CentOS 5 2 Geekzine org [...]
PCIamV Don?t you think he is a little late for the game?,
nice job, very thanks?,
Good One!,
Thanks I?ll give that a go!,
I will go to you.,
thank you this topic,
Hi! The post is really interesting! I?ve read your blog and can say it?s a good job.thanks,
Bravo! Nice Article.,
great tips. I enjoyed reading this,
Hi! The post is really interesting! I?ve read your blog and can say it?s a good job.thanks,
great site. I love online games,
Great work ?. Thanks for your ideas.,
great site. I love online games,
Bravo! Nice Article.,
Great stuff thanks for posting that. I find Im reading your posts more and more.
How did it cost to start up this blog…I want to start my own.
thanks so much i was like 3 week searching for this. good job man
great post, worked fine for me.
This post helped in installing wordpress. In some steps, this post explains better than the wordpress site.
Great post. It is also important to note how to install mysql and php.