Hosting Package and What They Mean to You

The larger or more complex a website, the more comprehensive a configuration package it’s going to need. The main ones are broken down as follows:

hosting package

  • Shared

Shared web hosting is the basic package that services offer. Your website sits on the same server along with many other websites, so you’re sharing the server, and any other resources, such as memory or CPU. These are good for basic website needs such as email sending, file sharing, and base level ecommerce sites. Shared hosting is the cheapest and therefore smartest option for smaller or startup businesses.

  • VPS

A virtual private server is designated for your direct purposes, more than a shared server. You still may be sharing an actual server, but the service creates a virtual server of your very own. That means all the resources are yours alone, from memory storage to processing power and beyond. This is a safer and much more reliable option. It keeps your site separate from the others while still maintaining affordability.

  • Dedicated

Dedicated hosting is already another level. In addition to getting your own server, dedicated hosting lets you take full control over your server. That means you have full administrative access and can set things up the way you like it. This type of package comes with a royal suite of features that may not be necessary for all types of businesses.

  • WordPress

WordPress is a shared hosting service that caters to a more specialized clientele. The servers themselves are optimized differently, and have features that are particularly attractive to WordPress performance such as faster load time, pre-installation, security features that work specifically with WordPress, and WordPress updates. This is useful for businesses that have websites created on WordPress.

Some Top Features When it Comes to Top Hosting Quality

Hosting quality is affected by several factors that are important to weigh during your decision making process. Some of the most significant ones include:

 Uptime guarantee

If you’re looking into web hosting, you’ll hear the term uptime guarantee a lot. That makes a lot of sense considering it is one of the most important factors when choosing a service. Uptime, which is the percentage of time that a hosting service is up and running, will be guaranteed by various companies with a certain percentage of time to be up. That doesn’t mean they will definitely go down for the other percentage of the time, but they can say without fail that they will be up for at least that amount of time.

The reason this is important is because you don’t want your site constantly being unavailable or unreachable to your customers. Otherwise, why have a website at all? A high uptime percentage ensures that your audience can see and interact with your website more often.  4hostings has one of the best uptime guarantees at 99.98% and that’s really good for your business.

 Load time

Load time is also really important. Recent studies show that the average attention span has shrunk over the years to smaller than that of a goldfish! So, if your website takes even a drop too long to load a page, your business is dead before it’s even started. To keep yourself in the running, be sure your hosting service has a fast load time. 4hostings  will deliver a fast load time for pages, the fastest in the industry.

Customer support

Because having an issue with your website is nothing to take lightly. You want to make sure customer service is available, knowledgeable, and easy to work with.

Location

The number of servers and location plays a huge part in the speed of your website loading and service. Obviously, the more servers available, the faster the service, but where those servers are found in the world will also affect the quality. Look for servers in substantial locations close to you.

 

As tempting as it may be to choose a web hosting provider quickly and just get on with your life, it’s undeniably better to take your time. In doing so, you’ll be able to find a provider you can stick with for the long haul.

Order-Now-4Hosting

Hosting Package and What They Mean to You

Low Cost Web Hosting

The World Wide Web is a key staple in our everyday life. It also offers a means for people to earn additional money. Whether you want to create a website of your own with ads on it, or just wish to sell some product. You will need a shared hosting provider so that your website will be always accessible on the web. But how do you discover one that is affordable enough?

Shared Web Hosting Services

There are plenty of web hosting companies providing hosting solutions. The rivalry is enormous and hence there are plenty of web hosting corporations. They struggling to provide cheap hosting services to gain more clients. The shared web hosting solution is relatively affordable. It allows companies to host many customers on one and the same web hosting server, thus reducing the cost of the hosting service. At the same time, the clients are provided with a reliable hosting service whose reliability is guaranteed by certain resource usage limits. Each customer has to comply with so that his website does not intervene in the proper operation of the rest of the web sites on the same web hosting server.

Flexible, Modestly Priced Hosting Packages

If you have looked around for a low cost web hosting solution for some time, and have a basis for comparison, you will appreciate the flexible and affordable prices that acquire Hosting offers. We give many extras – a low-cost domain name registration with each of our cheap web hosting packages, a cost-free site building tool and a charge-free, intuitive web application installation tool. Your site can be online in just a few minutes and, owing to the moderately priced web hosting service, you have to invest a little and gain a lot by.

Affordable, Multi-Function Hosting Packages

Besides hosting your web site, shared hosting plans offer you also the possibility. Then you can create your own mail accounts with your own personal domain name. The hosting Control Panel offered by Acquire Hosting includes very user-friendly. And full-featured tools for administering your files and for creating and managing your own e-mailbox accounts. Whether you pay on a monthly or on an yearly basis – it does not matter, the options do not alter and the prices are really good. If you do not want to set up an electronic mail client like Outlook or Thunderbird to access your mailboxes, there is also a webmail system. It allows you to access your email mailbox from any place as long as you have Internet access.

Low Cost Web Hosting

Free Website Hosting

 What is Free Website Hosting?

As the name suggests, free website hosting is a free non-paid web hosting service. There are many web hosts who provide subdomains to anyone who want to make website. Some of such popular free web hosts include Blogger and WordPress. When you make your websites with these free website hosting services, your website gets such name as yoursite.blogspot.com and yoursite.wordpress.com. If you want to get a website with a domain name that doesn’t include any external site’s name. So you must buy domain and then get web hosting which is usually a paid service. However, there are many web hosting companies. They provides free web hosting with some or the other products/services that you buy from them.

Benefits of Free Website Hosting

There is this single biggest advantage of free website hosting and that is- it comes free without any cost. Now if you are amazed at why these free web hosting companies let you make a website free of cost then. You may rest assured that they do not make any loss in this business. When you make your free website with them, they use your websites to place advertisements, banners and other forms of advertising media to earn revenue.

Sometimes, the revenue from advertisement is shared with the owner of the website and sometimes it’s not. For example, when you get free web hosting from blogger and if you use their AdSense service. Then you get a share in the revenue generated from the advertisements that they place on your websites.  when you make a free website using WordPress, you do not have any control on the placement or revenue generated from your free hosted website. The situation is altogether different when you get website hosted through paid web hosting service.

 

Differences between Free and Paid Web Hosting

Here are some major differences between free and paid website hosting services. It will give you a better understanding about what is free web hosting service and whether it’s worth to opt for such free hosting for websites?

Advertisements on your website are controlled by the web hosting company that provides you with the free web hosting. It can use pop-ups, banners or any other advertisement on your site on which you do not have control. If also you have partial control, you may only decide what size of banner would be displayed where on your site. You won’t have control over what advertisement you will show on the website. If you avail paid web hosting.Then you have full control over your website and no outsider can decide anything for it.

Customer support is missing for free website hosting.  Something which comes free cannot be asked to come with value added services. If something goes wrong with your website, there’s no customer support for websites made with free hosting. On the other hand, paid web hosting services not only give technical support to the customers but they also provide them with help guides, tutorials etc.

Low bandwidth and lesser data transfer capacity makes free website hosting vulnerable to greater downtime. Whereas paid website hosting gives you optimum bandwidth and data transfer for maximum uptime. You also can’t upload more images or videos when using free web hosting service as you don’t get enough disk space.

 

 

 

Free Website Hosting

Some tips to Host your E-Commerce Website

4hostings

About E-commerce Web Hosting

It is common knowledge that, anyone can create a without any need of in depth technical knowledge. However, the first task have to complete before you may launch your e-commerce website is finding the right e-commerce web hosting provider. E-commerce hosting is a generic phrase describing a kind of web hosting platform specifically used for serving e-commerce websites. E-commerce hosting is different to the standard web hosting. This website has a number of functionalities and features required to run and manage a commercial website.

Take a look at the main options you have when it comes to running your e-commerce site and comparing the hosting possibilities with your budget and business requirements.

Choosing a shared host

Many people go with a shared hosting option to stay within their strict business budgets. Shared hosting means that many businesses will share the same server and run their websites right along with yours. The problem with this is that a security issue on one site could mean a security breach with all of the rest. A high level of traffic on one site could affect the other sites and their customers may not way around for the site to run faster at a later time.

While shared hosting is one of the most popular choices for e-commerce sites due to its affordability, it’s usually not worth the money saved. With so many websites working on one single server, the shared internet connection and resources among all of these sites is a recipe for issues with load times, high traffic issues, restrictions on bandwidth and disk space, limitations on control, and the potential of a security issue. Despite the drawbacks, this may be a possible option for a small company or startup.

In-house hosting

in house hosting

You may also wish to use in-house hosting which would require you to provide a server room, purchase the needed hardware and software, hiring an IT team, and leasing reliable high-speed internet. Your IT staff would be in charge of handling the daily operations and the whole thing could add up really quickly.

They will make sure you are backed up, the security is constantly monitored, and that the server is always up and running. This is great for ensuring your customers can access your online store but it’s not going to be pretty in the budget. Many people avoid this option, despite the major benefits, because of the costs and complexities attached to the requirements behind an in-house host. A startup or small business would feel overwhelmed and financially drained doing this.

Colocation

An alternate route a company may decide is to colocation, which refers to a company that stores their hardware and network equipment in a hosting company’s facility. You’d get physical storage space, electricity for powering the hardware, and internet bandwidth.

This is great for those that don’t want to worry too much about hosting and it will save you so much money when it comes to bandwidth. You’ll have the reliability of the data center too. The problem with this option is that you have to purchase your own hardware. And find a provider that will accept this arrangement.

Are there any other options?

e-commerce hosting

Last but not least, you may consider going with dedicated and managed hosting options. This is incredibly expensive but it has a great pay off. You’ll get the whole server to yourself. It means no handing off the control over what operating system is used or web applications are in place.

You won’t have to worry about increased traffic with other websites. Because the traffic is only for you and you’ll have a ton of flexibility. This amazing option is very expensive but it may be worth it if you can find it in the budget. For those that don’t want to deal with too much of the management of the hosting. You can get manage hosting which takes away the server administration task. And it allows you to focus more on your site and customer rather than working on the processes of the hosting.

 

 

 

 

Some tips to Host your E-Commerce Website

10 Tips Before You Buy a Domain Name

domain name

One of the most important decisions in establishing an online presence is choosing a domain name. The right domain name for your website is important, for both your target audience and search engines.

Here are 10 tips to help you make a good domain name purchase.

1. Do your homework

A little bit of research can go a long way when buying a domain name. Browse available domains by keyword or domain name using Media Temple’s domain name search tool.

A popular domain may have more public resales. You can search by keyword, which helps provide the popularity of certain words in domain names.

2. Buy domains that are easy to type and remember

Even if you plan on optimizing the site for search engines, you still want a domain name that people can remember and type. Avoid odd spellings of words, multiple hyphens or other characters, numbers and so forth. Anyone hearing your name should know how to type it without you having to say things such as “the number 4” and “dash-dash.”

You should also avoid words that have more than one spelling if your visitors are likely to be confused and mistype the name. Alternately, you can buy both versions of the name and direct visitors from the one you like less to the preferred name. While you do want a short name (see below), don’t go for something so cryptic that people have a hard time remembering it. Word of mouth is a powerful marketing tool and you want to make it easy for people to tell their friends about your site.

3. Avoid slang terms

Try to avoid slang terms and instead pick a name that will still be meaningful in 10 years. This will also help your name be understood and remembered by non-native speakers. Whether or not you intend to do business internationally, this can help with your local audience as well.

4. Buy a domain that’s shorter rather than longer

The longer your domain name is, the harder it is for people to remember it and the more chance you have of someone misspelling one of the words. Most good single word domain names are long gone, but you can still avoid long domain names by getting a little creative. If you have a single word you really like that is not available, try adding an adjective or verb in front of it and seeing if those variations are available. Think of your domain name as part of your brand, and make sure it matches how you want people to think of you.

5. Stick with .com if you can

Most people assume a domain name ends in .com so if you buy a domain name with one of the other extensions (.net, .info, .org, etc.), you’ll have some extra work to get people to remember that your site has a different extension. Don’t automatically assume you should only buy domains with .com, though. Many sites have done quite well with other extensions.

6. Don’t buy trademarked domains

If your purpose in buying a trademarked term as a domain name is to try to confuse people, you’re opening yourself up to having a complaint filed against you and having to give up the domain name. Even if you’re not trying to create confusion, you’re likely to face some legal challenges by buying trademarked terms in your domain name.

7. Don’t buy a domain name that’s too similar to an existing site

Even if the term isn’t trademarked, don’t buy domains that are just a variation of another domain name. This means avoiding plurals if the singular is taken (mediatemple.net vs. mediatemples.net), hyphenating a phrase (media-temple.net), or adding “my” or some other preposition (mymediatemple.net). Alternately, you might consider buying these variations yourself and set them up so that if someone types one of the variations, they are redirected to your main site.

8. Hyphens are a mixed bag

Using hyphens to separate words in a domain name. It makes site easier to read and makes it somewhat easier for search engines to recognize the individual words. However, people often forget about the hyphens when they type domain names. If you do use hyphens in your name, don’t buy a domain with more than three hyphens. It’s just too messy.

9. Avoid numbers

Avoid having numbers in your domain name. People can get confused about whether the numbers is a digit (3) or a word (three). If you want a number in your domain name because there’s a number in your company name. For this reason, buy both versions (digit and word) and redirect one to the other. Be especially wary about using the number “0” in a domain name as people may see it as the letter “O.”

10. Check availability on social media sites

When you have a name picked out, go see if that word or phrase is available on social media sites. Social media like YouTube, Twitter, Facebook, Instagram, Pinterest, Google+, and Tumblr. Even if you don’t plan on using social media right away, you’ll want to have the option when you’re ready, and it’s easiest if you can use the same phrase on each site.

4hostings

10 Tips Before You Buy a Domain Name

Choosing the right web hosting service provider

Web Hosting Service Provider
We have clearly answered this question in this post. A web hosting service provider’s main goal is selling hosting space from his server or data center. Many other products and services, essential for website hosting. Also provide such as domain name registration, email hosting services, and SSL certificates etc.

However the most important products of a web host are the different types of web server hosting. So that their clients might choose the hosting space suitable to their specific needs.
What is Web Server?
Most of the web hosting service provider is using a very high configured web server. It delivers or ‘serves’ the content of your website to the users through Internet. The computer which acts as a server has to have very high specifications with a powerful Internet connection.

The web hosts or the web hosting companies have their own servers on which they rent out space to you. So that you can host your website and make it accessible to the general public.

Types of Web Server Hosting

Not all persons and even businesses require a similar type of web hosting service. 4hostings.com is a top class web hosting service provider. You will get different types of web hosting options as per your needs. And also help you migrate to a different hosting plan with the growth of your website.

Shared Server Hosting

As the name suggests, several webmasters share space on a single server. This type of hosting plan is good for small e-commerce sites, static website or a personal website. This kind of hosting price is cheap from others. The entry-level websites don’t need high-performance features and thus.  Shared hosting can fulfill their needs without having to pay larger amounts of money.

Dedicated Server Hosting

A server wholly dedicated for your website is a little costly. But could not be affected by the other websites as it could happen in a shared server hosting. This type of website hosting service is most suitable for websites that attract higher traffic and cannot afford to be down due to business purposes such as for e-commerce sites.

Cloud Server Hosting

Based on the innovative cloud computing technologies, cloud hosting is done through multiple servers inter connected with each other. This is unlike shared or dedicated server hosting that is provided through only one server. The multiple servers acting as a single system has multiple advantages like load balancing, no single point of failure, non-reliance on a single server leading to higher security and also the facility to increase or decrease server resources as per your needs. It is also cost-effective web hosting solution as the website hosting companies charge you for cloud hosting services on the basis of usage. As you can scale your resources up and down on a cloud server, you are able to use more resources only on the days when you expect higher traffic.

It is very tuff to combine all of the services in one place. But 4hostings.com done this job! For this reason, 4hostings.com is the one of the best web hosting service provider.

web hosting service provider

web hosting service provider in bangladesh

Choosing the right web hosting service provider

Web hosting

web hosting

Web hosting is a service that allows organizations and individuals to post a website or web page on to the Internet. A web host, or web hosting service provider, is a business that provides the technologies and services needed for the website or webpage to be viewed in the Internet. Websites are hosted, or stored, on special computers called servers.

When Internet users want to view your website, all they need to do is type your website address into their browser. Their computer will then connect to your server and your webpages will be delivered to them through the browser.

Most web hosting companies require that you own your domain name in order to host with them. If you do not have a domain name, the web hosting companies will help you purchase one.

The basic features of a web hosting plan include:

Disk Space

All web hosting accounts offer a certain amount of disk space that you can use to store your web files. It is recommended that you have some sort of estimates on what you need for various tasks – the amount of space you need for your emails, web files, databases, etc. By breaking down your usage, you can better estimate how much space you should go for.

Bandwidth or Data Transfer

Very often web hosts talk about bandwidth and data transfer as the same entity. However, they are in fact, different.

  1. Bandwidth is the amount of data that can be transferred at one time.
  2. Data transfer is the actual amount of data transferred.

Think of it this way. If bandwidth were a tunnel, the bigger the tunnel the more cars can pass through it. Data transfer would then be the number of cars allowed to go through the tunnel in a given time period, say a month.

The less bandwidth you have, the slower it takes your website to load, regardless of your visitor’s connection type. Visitors will have to wait their turn. The less data transfer you have, the more often you will find your website unavailable because you have reached the maximum amount of data allowed to be transferred.

To determine what is sufficient, you need to take into consideration the size of your website and the number of visitors you have in a month’s time.

Email Accounts

Email accounts are a common feature of web hosting, especially if you are hosting a domain. There are three main types of email accounts: POP3, forwarding, and aliases.

POP3 accounts are the traditional inboxes. You have space on the server to store your emails, and at the same time, you can use an email program to download your mail. Each login and password combination usually equates to one account.

Forwarding mail accounts are useful if you are employing the service of another company to filter your emails for you. Rather than storing your emails on your mail server, emails are redirected to another email address.

Aliases accounts are similar to forwarding mail accounts. Some hosts allow you to setup a catch-all alias, which is often used to collect emails sent to addresses not recognized by your mail server.

FTP Access

After you have created your web pages on your computer, you need to transfer those files to your web server. The files are transferred to the server by use of FTP.

FTP is also the protocol of downloading your web files from the server to your computer, ie. backing up your website files.

 

4hostings

Web hosting

The Implication of Website Speed in Business

4hostings

Running a successful online business doesn’t mean just building a website and creating awesome content. Those are just the first steps. Smart business owners need to make sure all that content can be accessed quickly and easily. Clients often ask me to audit their websites when they’re experiencing declining traffic and sales. The first thing I always check is their website’s load time.

Why should you care about Website Speed?

User experience

User experience is all about creating an amazing yet simple experience for your visitors. The 2 most important aspects to user experience: give users what they are looking for, and give it fast.

Also, remember that first impressions matter!

If your website loads quickly, your potential customers will be happy as you’ve made a very good first impression. People consider website speed to be professional and reliable.

On the other hand, a slow website makes people think it’s unsafe, insecure and untrustworthy. And it’s almost impossible to change this first impression later.

So, if you want to improve user experience and make a really good first impression on your potential customers, look closely at your loading speed. Users visiting your site are looking for something, so give it to them as quickly as possible before they go to your competitors.

Conversions & sales

The better the user experience, the more you sell. It’s as simple as that.

If half of your potential customers are leaving your site because of the loading speed, then it’s driving your conversions & sales away.

So if you don’t want to miss revenue opportunities, look at your website’s speed.

SEO

In 2010, Google announced that page speed would be one of the ranking factors taken into account when ranking websites. While it’s not the only factor that goes into your search engine rankings, pages that load faster and make use of Google’s recommended best practices tend to do better in search rankings than those that don’t.

In 2017, Google announced that page speed would become an even bigger factor in determining your site’s ranking. Your mobile and desktop sites will now be ranked based on signals Google receives from crawling your site through mobile view. This means that the page speed of your mobile site will determine the rankings of both your mobile and desktop sites in Google.

Google knows that site speed is important for users so, as I’m sure you care about your users, site speed should be important for you as well.

Recently Google updated its site speed tool adding competitor analysis like percentage of visitors lost due to poor loading speed and how your site compares to your industry:

What can you do to speed up your website?

Now that you know that website speed is super important, you’re probably wondering what you can do to speed your website. Well here are some tips:

  • Conduct a site audit – Use tools such as Pingdom, Load Impact and Google Page Speed to check your site’s speed and identify problem areas. Only after determining the cause of the slowdown will you be able to implement the proper fixes.
  • Re-evaluate your hosting provider – If you’re experiencing slow page loads, then it is very possible that your hosting may be at fault. In my experience, you need to carefully consider the web hosting that you pick and make sure that it is best for your needs. For high traffic sites, upgrading to a dedicated or managed web hosting solution is a good option.
  • Optimize the images on your website – Images are a great way to attract visitors to your website, but can adversely affect load times. This is why it is important to compress images for use on web. Tools like Adobe Photoshop, Yahoo Smush.it, and JPEG Mini allow you to compress your images and save bandwidth by serving smaller files which will speed up page loads.
  • Use a CDN – CDN short for Content Delivery Networks can greatly improve your site speed. CDN is a large distributed system of servers across several data centers across the world which allows you to serve static content such as images, stylesheets, and scripts with high performance.

Making your website fast and lean boils down to continuously monitoring and implementing site audits and analysis. The more you understand what affects your page load times, the better you’ll be able to improve it. Hiring an outside professional to audit your site can be of huge help. Have you conducted a speed test on your website lately? What issues are you currently experiencing? Share your experience by leaving a comment.

The Implication of Website Speed in Business

Create a SSL Certificate on Apache for CentOS 6

About Self-Signed Certificates

A SSL certificate is a way to encrypt a site’s information and create a more secure connection. Additionally, the certificate can show the virtual private server’s identification information to site visitors. Certificate Authorities can issue SSL certificate that verify the virtual server’s details while a self-signed certificate has no 3rd party corroboration.

Step One—Install Mod SSL

In order to set up the self signed certificate, we first have to be sure that Apache and Mod SSL are installed on our VPS. You can install both with one command:

yum install mod_ssl

Step Two—Create a New Directory

Next, we need to create a new directory where we will store the server key and certificate

mkdir /etc/httpd/ssl

Step Three—Create a Self Signed Certificate

When we request a new certificate, we can specify how long the certificate should remain valid by changing the 365 to the number of days we prefer. As it stands this certificate will expire after one year.

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/httpd/ssl/apache.key -out /etc/httpd/ssl/apache.crt

With this command, we will be both creating the self-signed SSL certificate and the server key that protects it, and placing both of them into the new directory.

This command will prompt terminal to display a lists of fields that need to be filled in.

The most important line is “Common Name”. Enter your official domain name here or, if you don’t have one yet, your site’s IP address.

You are about to be asked to enter information that will be incorporated

into your certificate request.

What you are about to enter is what is called a Distinguished Name or a DN.

There are quite a few fields but you can leave some blank

For some fields there will be a default value,

If you enter ‘.’, the field will be left blank.

—–

Country Name (2 letter code) [AU]:US

State or Province Name (full name) [Some-State]: New York

Locality Name (eg, city) []:NYC

Organization Name (eg, company) [Internet Widgits Pty Ltd]:Awesome Inc

Organizational Unit Name (eg, section) []:Dept of Merriment

Common Name (e.g. server FQDN or YOUR name) []:example.com

Email Address []:webmaster@awesomeinc.com

Step Four—Set Up the Certificate

Now we have all of the required components of the finished certificate.The next thing to do is to set up the virtual hosts to display the new certificate.

Open up the SSL config file:

vi /etc/httpd/conf.d/ssl.conf

Find the section that begins with <VirtualHost _default_:443> and make some quick changes.

Uncomment the DocumentRoot and ServerName line and replace example.com with your DNS approved domain name or server IP address (it should be the same as the common name on the certificate):

ServerName example.com:443

Find the following three lines, and make sure that they match the extensions below:

SSLEngine on

SSLCertificateFile /etc/httpd/ssl/apache.crt

SSLCertificateKeyFile /etc/httpd/ssl/apache.key

Your virtual host is now all set up. Save and Exit out of the file.

Step Five—Restart Apache

You are done. Restarting the Apache server will reload it with all of your changes in place.

/etc/init.d/httpd restart

 

 

Create a SSL Certificate on Apache for CentOS 6

A Basic MySQL Tutorial

MySQL

About MySQL

MySQL is open source database management software that helps users store, organize, and retrieve data. It is a very powerful program with a lot of flexibility—this tutorial will provide the simplest introduction to MySQL

How to Install MySQL on Ubuntu and CentOS

If you don’t have MySQL installed on your droplet, you can quickly download it.

Ubuntu:

sudo apt-get install mysql-server

Centos:

sudo yum install mysql-server

/etc/init.d/mysqld start

How to Access the MySQL shell

Once you have MySQL installed on your droplet, you can access the MySQL shell by typing the following command into terminal:

mysql -u root -p

After entering the root MySQL password into the prompt (not to be confused with the root droplet password), you will be able to start building your MySQL database.

Two points to keep in mind:

  • All MySQL commands end with a semicolon; if the phrase does not end with a semicolon, the command will not execute.
  • Also, although it is not required, MySQL commands are usually written in uppercase and databases, tables, usernames, or text are in lowercase to make them easier to distinguish. However, the MySQL command line is not case sensitive.

How to Create and Delete a MySQL Database

MySQL organizes its information into databases; each one can hold tables with specific data.

You can quickly check what databases are available by typing:

SHOW DATABASES;

Your screen should look something like this:

mysql> SHOW DATABASES;

+——————–+

| Database           |

+——————–+

| information_schema |

| mysql              |

| performance_schema |

| test               |

+——————–+

4 rows in set (0.01 sec)

Creating a database is very easy:

CREATE DATABASE database name;

In this case, for example, we will call our database “events.”

mysql> SHOW DATABASES;

+——————–+

| Database           |

+——————–+

| information_schema |

| events             |

| mysql              |

| performance_schema |

| test               |

+——————–+

5 rows in set (0.00 sec)

In MySQL, the phrase most often used to delete objects is Drop. You would delete a MySQL database with this command:

DROP DATABASE database name;

How to Access a MySQL Database

Once we have a new database, we can begin to fill it with information.

The first step is to create a new table within the larger database.

Let’s open up the database we want to use:

USE events;

In the same way that you could check the available databases, you can also see an overview of the tables that the database contains.

SHOW tables;

Since this is a new database, MySQL has nothing to show, and you will get a message that says, “Empty set”

How to Create a MySQL Table

Let’s imagine that we are planning a get together of friends. We can use MySQL to track the details of the event.

Let’s create a new MySQL table:

CREATE TABLE potluck (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,

name VARCHAR(20),

food VARCHAR(30),

confirmed CHAR(1),

signup_date DATE);

This command accomplishes a number of things:

  1. It has created a table called potluck within the directory, events.
  2. We have set up 5 columns in the table—id, name, food, confirmed, and signup date.
  3. The “id” column has a command (INT NOT NULL PRIMARY KEY AUTO_INCREMENT) that automatically numbers each row.
  4. The “name” column has been limited by the VARCHAR command to be under 20 characters long.
  5. The “food” column designates the food each person will bring. The VARCHAR limits text to be under 30 characters.
  6. The “confirmed” column records whether the person has RSVP’d with one letter, Y or N.
  7. The “date” column will show when they signed up for the event. MySQL requires that dates be written as yyyy-mm-dd

Let’s take a look at how the table appears within the database using the “SHOW TABLES;” command:

mysql> SHOW TABLES;

+——————+

| Tables_in_events |

+——————+

| potluck          |

+——————+

1 row in set (0.01 sec)

We can remind ourselves about the table’s organization with this command:

DESCRIBE potluck;

Keep in mind throughout that, although the MySQL command line does not pay attention to cases, the table and database names are case sensitive: potluck is not the same as POTLUCK or Potluck.

mysql>DESCRIBE potluck;

+————-+————-+——+—–+———+—————-+

| Field       | Type        | Null | Key | Default | Extra          |

+————-+————-+——+—–+———+—————-+

| id          | int(11)     | NO   | PRI | NULL    | auto_increment |

| name        | varchar(20) | YES  |     | NULL    |                |

| food        | varchar(30) | YES  |     | NULL    |                |

| confirmed   | char(1)     | YES  |     | NULL    |                |

| signup_date | date        | YES  |     | NULL    |                |

+————-+————-+——+—–+———+—————-+

5 rows in set (0.01 sec)

How to Add Information to a MySQL Table

We have a working table for our party. Now it’s time to start filling in the details.

Use this format to insert information into each row:

INSERT INTO `potluck` (`id`,`name`,`food`,`confirmed`,`signup_date`) VALUES (NULL, “John”, “Casserole”,”Y”, ‘2012-04-11’);

Once you input that in, you will see the words:

Query OK, 1 row affected (0.00 sec)

Let’s add a couple more people to our group:

INSERT INTO `potluck` (`id`,`name`,`food`,`confirmed`,`signup_date`) VALUES (NULL, “Sandy”, “Key Lime Tarts”,”N”, ‘2012-04-14’);

INSERT INTO `potluck` (`id`,`name`,`food`,`confirmed`,`signup_date`) VALUES (NULL, “Tom”, “BBQ”,”Y”, ‘2012-04-18’);

INSERT INTO `potluck` (`id`,`name`,`food`,`confirmed`,`signup_date`) VALUES (NULL, “Tina”, “Salad”,”Y”, ‘2012-04-10’);

We can take a look at our table:

mysql> SELECT * FROM potluck;

+—-+——-+—————-+———–+————-+

| id | name  | food           | confirmed | signup_date |

+—-+——-+—————-+———–+————-+

|  1 | John  | Casserole      | Y         | 2012-04-11  |

|  2 | Sandy | Key Lime Tarts | N         | 2012-04-14  |

|  3 | Tom   | BBQ            | Y         | 2012-04-18  |

|  4 | Tina  | Salad          | Y         | 2012-04-10  |

+—-+——-+—————-+———–+————-+

4 rows in set (0.00 sec)

How to Update Information in the Table

Now that we have started our potluck list, we can address any possible changes. For example: Sandy has confirmed that she is attending, so we are going to update that in the table.

UPDATE `potluck`

SET

`confirmed` = ‘Y’

WHERE `potluck`.`name` =’Sandy’;

You can also use this command to add information into specific cells, even if they are empty.

How to Add and Delete a Column

We are creating a handy chart, but it is missing some important information: our attendees’ emails.

We can easily add this:

ALTER TABLE potluck ADD email VARCHAR(40);

This command puts the new column called “email” at the end of the table by default, and the VARCHAR command limits it to 40 characters.

However, if you need to place that column in a specific spot in the table, we can add one more phrase to the command.

ALTER TABLE potluck ADD email VARCHAR(40) AFTER name;

Now the new “email” column goes after the column “name”.

Just as you can add a column, you can delete one as well:

ALTER TABLE potluck DROP email;

I guess we will never know how to reach the picnickers.

How to Delete a Row

If needed, you can also delete rows from the table with the following command:

DELETE from [table name] where [column name]=[field text];

For example, if Sandy suddenly realized that she will not be able to participate in the potluck after all, we could quickly eliminate her details.

mysql> DELETE from potluck  where name=’Sandy’;

Query OK, 1 row affected (0.00 sec)

 

mysql> SELECT * FROM potluck;

+—-+——+———–+———–+————-+

| id | name | food      | confirmed | signup_date |

+—-+——+———–+———–+————-+

|  1 | John | Casserole | Y         | 2012-04-11  |

|  3 | Tom  | BBQ       | Y         | 2012-04-18  |

|  4 | Tina | Salad     | Y         | 2012-04-10  |

+—-+——+———–+———–+————-+

3 rows in set (0.00 sec)

Notice that the id numbers associated with each person remain the same.

 

A Basic MySQL Tutorial