Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Install And Setup Wordpress 3.4.1 on CentOS6/5, Fedora/17/16/15 (Part 1)


WordPress is a free and open source blogging and website application works with MySQL database and PHP. Now WordPress is one of the widely used website/blogging platform that features a wide range of plugins and template support, themes, widgets, multi-users and many more.

This article is a step by step guide to install and configure a WordPress blog/website on your Linux platform. I used CentOS 6 version to test this configurations with Wordpress version 3.4.1. And this configuration will word on CentOS6/5 versions and Fedora17/16/15/14 versions. A MySQL database (server) is required to perform back end database operations. Read my articles about installing MySQL Server and configuring MySQL server on CentOS linux.
You need to add EPEL repository to your Linux server to install wordpress packages from EPEL repository. Read my article about setting up EPEL repository in CentOS Linux.

Install Wordpress packages from EPEL repository
[root@server ~]# yum --enablerepo=epel install wordpress
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
 * base: centos.01link.hk
 * extras: centos.01link.hk
 * updates: centos.aol.in
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package wordpress.noarch 0:3.4.1-1.el6 set to be updated
--> Processing Dependency: php >= 5.2.4 for package: wordpress-3.4.1-1.el6.noarc                                h
--> Processing Dependency: php-simplepie for package: wordpress-3.4.1-1.el6.noar                                ch
--> Processing Dependency: php-mysql for package: wordpress-3.4.1-1.el6.noarch
--> Processing Dependency: php-gettext for package: wordpress-3.4.1-1.el6.noarch
--> Running transaction check
---> Package php.x86_64 0:5.3.3-14.el6_3 set to be updated
--> Processing Dependency: php-cli = 5.3.3-14.el6_3 for package: php-5.3.3-14.el                                6_3.x86_64
---> Package php-common.x86_64 0:5.3.3-14.el6_3 set to be updated
---> Package php-mysql.x86_64 0:5.3.3-14.el6_3 set to be updated
--> Processing Dependency: php-pdo for package: php-mysql-5.3.3-14.el6_3.x86_64
---> Package php-simplepie.noarch 0:1.1.3-4.el6 set to be updated
--> Processing Dependency: php-IDNA_Convert for package: php-simplepie-1.1.3-4.e                                l6.noarch
--> Running transaction check
---> Package php-IDNA_Convert.noarch 0:0.7.0-1.el6 set to be updated
---> Package php-cli.x86_64 0:5.3.3-14.el6_3 set to be updated
---> Package php-pdo.x86_64 0:5.3.3-14.el6_3 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

====================================================
 Package                Arch         Version                Repository     Size
====================================================
Installing:
 wordpress              noarch       3.4.1-1.el6            epel          4.1 M
Installing for dependencies:
 php                    x86_64       5.3.3-14.el6_3         updates       1.1 M
 php-IDNA_Convert       noarch       0.7.0-1.el6            epel           34 k
 php-cli                x86_64       5.3.3-14.el6_3         updates       2.2 M
 php-common             x86_64       5.3.3-14.el6_3         updates       523 k
 php-mysql              x86_64       5.3.3-14.el6_3         updates        79 k
 php-pdo                x86_64       5.3.3-14.el6_3         updates        73 k
 php-simplepie          noarch       1.1.3-4.el6            epel          317 k

Transaction Summary
=====================================================
Install       8 Package(s)
Upgrade       0 Package(s)

Total download size: 8.4 M
Installed size: 25 M
Is this ok [y/N]: y
Downloading Packages:
(1/8): php-5.3.3-14.el6_3.x86_64.rpm                     | 1.1 MB     00:23
(2/8): php-IDNA_Convert-0.7.0-1.el6.noarch.rpm           |  34 kB     00:01
(3/8): php-cli-5.3.3-14.el6_3.x86_64.rpm                 | 2.2 MB     00:27
(4/8): php-common-5.3.3-14.el6_3.x86_64.rpm              | 523 kB     00:04
(5/8): php-mysql-5.3.3-14.el6_3.x86_64.rpm               |  79 kB     00:00
(6/8): php-pdo-5.3.3-14.el6_3.x86_64.rpm                                                 |  73 kB     00:00
(7/8): php-simplepie-1.1.3-4.el6.noarch.rpm                                              | 317 kB     00:09
(8/8): wordpress-3.4.1-1.el6.noarch.rpm                                                  | 4.1 MB     00:25
----------------------------------------------------------------------------------------
Total
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : php-common-5.3.3-14.el6_3.x86_64
  Installing     : php-cli-5.3.3-14.el6_3.x86_64
  Installing     : php-5.3.3-14.el6_3.x86_64
  Installing     : php-pdo-5.3.3-14.el6_3.x86_64
  Installing     : php-mysql-5.3.3-14.el6_3.x86_64
  Installing     : php-IDNA_Convert-0.7.0-1.el6.noarch
  Installing     : php-simplepie-1.1.3-4.el6.noarch
  Installing     : wordpress-3.4.1-1.el6.noarch

Installed:
  wordpress.noarch 0:3.4.1-1.el6

Dependency Installed:
  php.x86_64 0:5.3.3-14.el6_3          php-IDNA_Convert.noarch 0:0.7.0-1.el6   p
  php-common.x86_64 0:5.3.3-14.el6_3   php-mysql.x86_64 0:5.3.3-14.el6_3       p
  php-simplepie.noarch 0:1.1.3-4.el6

Complete!

Continue your Configurations
Now continue Setting up your Wordpress blog, Read my next article about Configure Wordpress Blogging platform.

MySQL Set Root Password For The First Time


After installing MySQL database  server, step by step guide to set MySQL Root Password For The First Time
Login into MySQL database for the first time

[root@server ~]# mysql -u root

Set the root password for all the local domains of the server. (use ur own domain names)
mysql> set password for root@localhost=password('mypassword123');
mysql> set password for root@127.0.0.1=password('mypassword123');
mysql> set password for root@localhost.localdomain=password('mypassword123');

Deny anonymous users to MySQL database
mysql> delete from mysql.user where user='';
mysql> exit
Bye

Login into MySQL database with the password
[root@server ~]# mysql -u root -p
Password                                 <enter the password>

Setup MySQL Database On CentOS 6

After installing MySQL database server packages you need to configure the MySQL database. The commands are same for CentOS6,5,4

Starting the MySQL database service(daemon) for the first time.
[root@server ~]# service mysqld start
or
[root@server ~]# /etc/rc.d/init.d/mysqld start

Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

Add MySQL service to Linux startup
[root@server ~]# chkconfig mysqld on

Login into MySQL database for the first time
[root@server ~]# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.61 Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

Set the root password for all the local domains of the server. (use ur own domain names)
mysql> set password for root@localhost=password('mypassword123');
mysql> set password for root@127.0.0.1=password('mypassword123');
mysql> set password for root@localhost.localdomain=password('mypassword123');

Deny anonymous users to MySQL database
mysql> delete from mysql.user where user='';

mysql> exit
Bye

Login into MySQL database with password
[root@server ~]# mysql -u root -p
Password                                 <enter the password>


Installing MySQL Database Server On CentOS6

FREQUENTLY ASKED QUESTIONS (MySQL)
Q: How do i install MySQL server from YUM on CentOS Linux Server?

Installing/Setup MySQL Database Server on CentOS6 Linux. The command is same for all CentOS versions like CentOS5, CentOS4, etc.

[root@server ~]# yum install mysql-server
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile

 * base: centos.01link.hk
 * extras: centos.01link.hk
 * updates: centos.aol.in
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-server.x86_64 0:5.1.61-4.el6 set to be updated
--> Processing Dependency: mysql = 5.1.61-4.el6 for package: mysql-server-5.1.61-4.el6.x86_64
--> Processing Dependency: perl-DBI for package: mysql-server-5.1.61-4.el6.x86_64
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.61-4.el6.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-server-5.1.61-4.el6.x86_64
--> Running transaction check
---> Package mysql.x86_64 0:5.1.61-4.el6 set to be updated
--> Processing Dependency: mysql-libs = 5.1.61-4.el6 for package: mysql-5.1.61-4.el6.x86_64
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 set to be updated
---> Package perl-DBI.x86_64 0:1.609-4.el6 set to be updated
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.1.61-4.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================
 Package                        Arch                   Version                       Repository            Size
========================================================================
Installing:
 mysql-server               x86_64                 5.1.61-4.el6                  base                 8.6 M
Installing for dependencies:
 mysql                          x86_64                 5.1.61-4.el6                  base                 882 k
 perl-DBD-MySQL     x86_64                 4.013-3.el6                   base                 134 k
 perl-DBI                     x86_64                 1.609-4.el6                   base                 705 k
Updating for dependencies:
 mysql-libs                    x86_64                 5.1.61-4.el6                  base                 1.2 M

Transaction Summary
========================================================================
Install       4 Package(s)
Upgrade       1 Package(s)

Total download size: 11 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): mysql-5.1.61-4.el6.x86_64.rpm                                                        | 882 kB     00:06
(2/5): mysql-libs-5.1.61-4.el6.x86_64.rpm                                                  | 1.2 MB     00:15
(3/5): mysql-server-5.1.61-4.el6.x86_64.rpm                                              | 8.6 MB     01:01
(4/5): perl-DBD-MySQL-4.013-3.el6.x86_64.rpm                                     | 134 kB     00:00
(5/5): perl-DBI-1.609-4.el6.x86_64.rpm                                                     | 705 kB     00:04
------------------------------------------------------------------------------------------------------------
Total                                                                           129 kB/s |  11 MB     01:30
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
base/gpgkey                                                                              | 3.3 kB     00:00 ...
Importing GPG key 0xC105B9DE "CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating       : mysql-libs-5.1.61-4.el6.x86_64                                                           1/6
  Installing     : perl-DBI-1.609-4.el6.x86_64                                                                2/6
  Installing     : perl-DBD-MySQL-4.013-3.el6.x86_64                                                 3/6
  Installing     : mysql-5.1.61-4.el6.x86_64                                                                     4/6
  Installing     : mysql-server-5.1.61-4.el6.x86_64                                                          5/6
  Cleanup        : mysql-libs-5.1.47-4.el6.x86_64                                                            6/6

Installed:
  mysql-server.x86_64 0:5.1.61-4.el6

Dependency Installed:
  mysql.x86_64 0:5.1.61-4.el6      perl-DBD-MySQL.x86_64 0:4.013-3.el6      perl-DBI.x86_64 0:1.609-4.el6

Dependency Updated:
  mysql-libs.x86_64 0:5.1.61-4.el6

Complete!

Verify the Installed package
[root@server ~]# rpm -q mysql
mysql-5.1.61-4.el6.x86_64

After installing MySQL packages, click for Setting up MySQL database 

Related Posts Plugin for WordPress, Blogger...

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons