• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » Separate MySQL Database Setup on Rackspace Cloud Server

By Abhishek Ghosh August 22, 2014 11:09 am Updated on August 22, 2014

Separate MySQL Database Setup on Rackspace Cloud Server

Advertisement

Here is a Step by Step Guide on How To Setup a Separate MySQL Database Server on Rackspace Cloud Server and Connect From FTP Server Easily. For scalability on cloud computing platform, we need to distribute the load. To run WordPress like CMS, it is almost mandatory to separate the application server from FTP server. In our case, the application server is MySQL Database Server; MySQL by default is not ready to accept connection requests even within the same network. First, we will explain the logical approach for running a separate MySQL Database setup on Rackspace Cloud and Secondly we will provide you the needed commands. We need only the ServiceNet IP address (= Private Network) of both the Server Instances. There is no bandwidth charge for connecting to the server. Possibly it is better to judge your need of amount of RAM before going for this setup. An one GB PVHVM for MySQL Database instance is quite fine for most of the WordPress websites with medium traffic load. Keep in mind – you need to tweak the MySQL instance later. Otherwise MySQL will use a limited small amount of RAM!

 

Principle of Running a Separate MySQL Database Setup on Rackspace Cloud Server

 

The server which will be used as MySQL database server, name it accordingly to avoid confusion. You can change the default welcome message on SSH too. Often the things go wrong only for getting confused with more than 3-4 servers!

By default, MySQL Server keeps the bind-address in /etc/mysql/my.cnf to localhost. We need to change it to this database server’s ServiceNet IP address (= Private Network). Understand it – instead of localhost or 127.x.x.x.x we will use the specific IP address. We could use the public IP address, but we – (i) want to reduce our bill (ii) disallow anyone outside Rackspace to connect to our MySQL Server.

Advertisement

---

Second thing is related to creation of database – we will run the SQL queries to create database, give permission using the FTP server’s ServiceNet IP address (= Private Network).

Make it clear. There is no other big deal.

Separate MySQL Database Setup on Rackspace Cloud Server

 

Commands For Running a Separate MySQL Database Setup on Rackspace Cloud Server

 

After successfully spinning up the two servers (FTP and MySQL server), ssh to the server which you’ll run MySQL only. Run these commands :

Vim
1
2
3
apt-get update
apt-get install mysql-server
# keep note of the root password

Now run this command :

Vim
1
mysql_install_db

After this step, on earlier versions, we used to run :

Vim
1
mysql_secure_installation

Now you will get the needed commands as output after running mysql_install_db command. Just copy paste and run it or run the above one. You will need to enter the MySQL root password that you provided above. Afterwards, it will ask questions. To all of these questions except changing the password and allowing remote connection, you should just hit ENTER/RETURN key to select the default options which will remove some test databases and secure it.

Now open the config file :

Vim
1
nano /etc/mysql/my.cnf

Search the word bind-address with ^ + W (on Mac, keyboard mapping can differ on other OS) and change it to this MySQL Server’s ServiceNet IP address from default localhost value :

Vim
1
2
3
4
# before
bind-address        = localhost
# after
bind-address        = your_service_net_IP

Save it using ^ + O, exit with ^ + X. Restart MySQL :

Vim
1
2
3
service mysql restart
# check status
service mysql status

Forget this server’s ServiceNet IP address! Now your work is with only the FTP server’s ServiceNet IP address. If you have multiple FTP servers, you have to repeat the steps. Examples are given with easy to guess words, change them :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# login to mysql as root
mysql -u root -p
# change the database name from wordpress to difficult one
CREATE DATABASE wordpress;
# change the wordpressuser, service_net_IP (=FTP server's IP), password
CREATE USER 'wordpressuser'@'service_net_IP' IDENTIFIED BY 'password';
# how much you want to grant access?
GRANT SELECT,DELETE,INSERT,UPDATE ON wordpress.* TO 'wordpressuser'@'service_net_IP';
# normally we give all
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'service_net_IP';
# mandatory
FLUSH PRIVILEGES;
# check
show databases;
# exit
exit

Exit the SSH session. SSH to your FTP server, install the web server software you want (Apache, nginx…) and only install MySQL client :

Vim
1
apt-get install mysql-client

You can login from this server to that database server with this command :

Vim
1
mysql -u wordpressuser -h database_server_service_net_IP -p

There should be no error. You’ll proceed to install WordPress or whatever, use database server’s ServiceNet IP to connect (instead of localhost as database name). After WordPress get installed, you can go to Rackspace Cloud Control Panel and switch off Public IP address of the Database Server. First, we will never need it as we can access MySQL from the allowed server, Secondly, you can add public IP at anytime (or loadbalancer) to SSH on need, Thirdly, it increases the security and finally – the number of white listed IP address is limited in the whole World, we should release which we will not need.

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Separate MySQL Database Setup on Rackspace Cloud Server

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • Installing WordPress on Rackspace Cloud Server with Cloud Database

    Installing WordPress on Rackspace Cloud Server with Cloud Database can give you a good performance with scalable and economically best solution. Simple Guide.

  • Install WordPress on Rackspace Cloud Server : Step by Step Guide

    Install Wordpress on Rackspace Cloud Server on Rackspace Cloud Server within few minutes, UNIX commands are included in this step by step guide.

  • Repairing WordPress Database : Using Cloud Database Server

    Repairing WordPress Database is easy by using Cloud Database Server like from The Rackspace Cloud which provides MySQL database server with PHPmyAdmin software.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Tips on S Pen Air ActionsSeptember 24, 2023
  • Market Segmentation in BriefSeptember 20, 2023
  • What is Booting?September 18, 2023
  • What is ncurses?September 16, 2023
  • What is JTAG in Electronics?September 15, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy