All posts tagged mysql

New server setup

By Tavis J. Hampton in: VPS & Dedicated Web servers

server rack

Question: I want to setup my own server. What software and tools will I need?

Answer: The first major decision to make after you have purchased server hardware is what operating system to use. Many servers come with one already, but if yours does not, you will need to decide on one. Linux or other Unix variants, such as BSD or Solaris are by far the most popular, but there are also many Windows servers out there. If you are on a limited budget, go with a free Linux distribution, such as CentOS.

The next thing to choose is the web server. Choices include Apache, Nginx, and Lighttpd. After that, you will probably one a database server such as MySQL or PostgreSQL Finally, you will want a web-based control panel. Depending on the one you choose, it might also install its own versions of Apache, PHP, and MySQL.

There are many control panel solutions on the market, and most of them are commercial. Popular control panels includ cPanel and Plesk. There are also free solutions available like Virtualmin. Decide what you need for whatever type of websites you plan to have and then choose the software that meets those needs.

Photo: Flickr

Continue reading: New server setup

....
share this 0 comments

Twitter the latest among big players to leave MySQL for Cassandra

By Tavis J. Hampton in: Web servers Software

Twitter home page

With a name that even sounds like the beautiful love interest of a secret affair, Cassandra appears to be positioning itself to steal the hearts of those once in love with MySQL. Twitter is now set to replace its MySQLdatabase system with the open source home wrecker.

Cassandra was originally developed by Facebook and was released to the public via Google’s code repository in 2008. In 2009, the Apache Foundation added it to its project, and in February of 2010, Apache made it a top-level project. It is designed to work with large amounts of data by spreading the data across multiple servers. Its notable feature is that it has no single point of failure.

Twitter joined a growing list of major companies that have adopted Cassandra. Among them are Digg, Cisco, IBM. Cassandra is free and open source software released under the Apache License 2 and is available for download from Apache.org.

Photo: Flickr

Continue reading: Twitter the latest among big players to leave MySQL for Cassandra

....
share this 0 comments

How to check and optimize MySQL databases automatically

By Tavis J. Hampton in: Web Hosting VPS & Dedicated Software

MySQL table repair in phpMyAdmin

MySQL databases require regular maintenance, but usually the databases just need to be re-optimized and checked for errors. In such cases, having to go through each database on your server can be time consuming. Following these steps, you can setup a cron job that will automatically check and repair your databases.

1. Login to the server via SSH
2. Edit the crontab file found in /etc/crontab

# crontab -e

3. Enter the following line in the crontab file:

0 1 * * * mysqlcheck -Aao –auto-repair -u root -p[password] > /dev/null

This will check all databases on the server. If you do not have root access and only want to check your own website, you can edit your cron in your control panel or replace the “root” user with your MySQL username. Save the file, and cron will now start mysqlcheck at 1 am everyday to optimize and check all databases.

Source: My Digital Life
Photo: Flickr

Continue reading: How to check and optimize MySQL databases automatically

....
share this 0 comments

Micro-blogging on your own domain with StatusNet

By Tavis J. Hampton in: Web Hosting Web servers Software

StatusNet

Twitter has become very popular in a short amount of time. With it, users can post short updates about what they are currently doing, working on, thinking, or viewing/accessing. For businesses, it is a good way to communicate with others who might not be in the same office or even the same city or country. The downside to this is that Twitter is used by so many others for other purposes, and users are often inundated with requests.

Running a micro-blogging server of your own might be very appealing, particularly if you only need it for a company’s business and do not want outsiders to view it. While hosted solutions like Twitter offer privacy options, you would still be trusting your security to a third party. StatusNet is a free micro messaging platform that powers the also popular Identi.ca.

You can host it on your own domain, share files, create groups, add plug-ins and applications, and access it via both desktop computers and mobile devices. It is a PHP application that stores data in MySQL databases. StatusNet is free software released under the GNU AGPL and is available for download directly from the project’s website.

Continue reading: Micro-blogging on your own domain with StatusNet

....
share this 0 comments

Monitoring your server from your iPhone

By Tavis J. Hampton in: Web Hosting Web Services Software

iPhone in hand

Picture this. You’re on the go, traveling, working, going on a date, or even just taking a nap, and you suddenly start getting phone calls. Little do you know that those phone calls are from angry customers or your boss. The server went down two hours ago, but you had no idea what was going on.

Many of us in the IT industry, particularly server administrators, have experienced a scenario like this one. It could be something small. Maybe Apache just needs a restart, but instead of it being a small issue, your stakeholders blow it out of proportion. Rather than getting upset with them and possibly losing your job, why not put your iPhone to use?

Root Internet, an Internet service company, offers an iPhone server monitoring tool. It pings HTTP, HTTPS, FTP, SSH, SMTP, DNS, POP3, IMAP, MySQL, and custom TCP/IP services that you specify. When your server experiences trouble, you will receive a notification on your iPhone, through email, and even a text message. Now you can rest easy and enjoy your vacation time - that is until the next disaster strikes.

Source: Apple.com
Photo: Flickr

Continue reading: Monitoring your server from your iPhone

....
share this 0 comments

What is 127.0.0.1?

By Tavis J. Hampton in: VPS & Dedicated Web servers

Welcome mat saying there's no place like 127.0.0.1

Question: I have been setting up my own server, and a lot of help documents refer to the 127.0.0.1 address. What is 127.0.0.1?

Answer: 127.0.0.1 is the standard ip address assigned to the lookback network interface in IPv4. Because it is a standard, all server should conform to it, and you should be able to access any open ports on your own server through that address. It is also known by the hostname “localhost”, and it is actually more common for documentation to use localhost just in case a server happens to use a different ip address.

If you are running Apache on a local machine, you can use 127.0.0.1 or localhost to access it through a web browser or other method. It is also used by MySQL, CUPS, and many other services, all using their own various ports. Even if no other network devices are setup on a Linux server, the “lo” loopback device should still be present. To find out information about it, you can type “ifconfig” from the command line. It should produce output that looks something like this:

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:49476 errors:0 dropped:0 overruns:0 frame:0
TX packets:49476 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9790315 (9.7 MB) TX bytes:9790315 (9.7 MB)

Photo Source: Flickr

Continue reading: What is 127.0.0.1?

....
share this 0 comments

Installing software on an OpenSolaris server

By Tavis J. Hampton in: VPS & Dedicated Web servers

OpenSolaris logo
Continuing with our tour of server operating systems, today we will take a look at Sun Microsystems’ OpenSolaris, the free and open source version of the popular Unix-based Solaris OS. Those who experience with other Unix or Linux servers should find much of OpenSolaris familiar. Nevertheless, there are some key differences.

One of the first things you will want to do with a new OpenSolaris dedicated server would be to install software. The command for installing packages is “pkg”. For example, if you wanted to install mysql, you would type from the command line:

pfexec pkg install SUNWmysql

To install the complete PHP, MySQL, and Apache stack, install the meta package called “amp”.

pfexec pkg install amp

The same command “pkg install” can be used for upgrading packages, and it will automatically upgrade any of the packages dependencies as well. For more information about installing packages in OpenSolaris, see the Sun website.

Continue reading: Installing software on an OpenSolaris server

....
share this 0 comments

WampServer on Windows

By Tavis J. Hampton in: Web Hosting Web servers Software

WampServer

We have spent a great deal of blog space learning about Linux servers and how to optimize them, but Linux is certainly not the only kid on the block. This week we will look at some other operating systems and how they interact with the Web. First up is Microsoft Windows.

The standard web server on Windows comes with Microsoft’s IIS (Internet Information Service), but some of us still prefer open source technologies even on Windows. LAMP (Linux Apache MySQL and PHP) has become famous for its stability and reliability, but some people prefer to replace the L with a W. What you get is WAMP, and there is free software available that will install WAMP for you automatically on Windows. It is called WampServer.

WampServer will install versions of Apache, MySQL, and PHP on your Windows system with little hassle. The site does not seem to specify which versions of Windows it supports, but it should work with any Windows server. In addition to the base release, there are also addons that users can install to extend the application’s usability. WampServer is free software released under the GNU General Public License.

Source: WampServer

Continue reading: WampServer on Windows

....
share this 0 comments

How to manually grant privileges in MySQL

By Tavis J. Hampton in: Web Hosting Software

MySQL Database

There are plenty of reasons why you might want to grant various privileges to a user in MySQL manually rather than with a control panel or phpMyAdmin. But regardless of the reason, the process is quick and easy, once you learn how to do it. For this you will need SSH access, which you will have with your own server or with special permission from your web hosting provider.

In this example, you will grant a user the “SELECT” privilege.

1. First login to your server via SSH and enter the following:

mysql -uadmin -p`cat /etc/psa/.psa.shadow`

(you will be prompted for your password)

2. At the “mysql>” prompt, enter:

GRANT SELECT ON database.* TO username@'localhost' IDENTIFIED BY 'password';

After you have assigned privileges, enter:

FLUSH PRIVILEGES;

You will need to replace “database”, “username”, and “password” with the appropriate information. That is all it takes to enter a basic privilege. For more extensive examples, see mediatemple.net

Photo Source: Flickr

Continue reading: How to manually grant privileges in MySQL

....
share this 0 comments

How to create a MySQL database in cPanel

By Tavis J. Hampton in: Web Hosting Software

cPanel database creation

Question: How can I use cPanel to create a MySQL database?

Answer: cPanel uses its own web-based frontend to make database creation very easy. Just follow these simple steps:

1. Login to cPanel
2. Under the Databases section, click “MySQL Databases”
3. Where it says “Create New Database” enter a short name for your database.
4. Click “Create Database”.

Next, you will need to have a user for the database. If you do not have any users, you will need to create one. If you do, skip to step 4.

1. Scroll down to the bottom until you see “Add New User”.
2. Enter a name and password.
3. Click “Create User”
4. Under “Add User To Database” find your user in the dropdown menu and then find the database you created in the second dropdown menu.
5. Click “Add”.

You have now created a database that will give permissions to the user you created. When you install scripts or applications, they will access the database using the username and password you specified. Therefore, make sure you remember it, but also make sure it is secure.

Continue reading: How to create a MySQL database in cPanel

....
share this 0 comments

Restoring a huge MySQL database

By Tavis J. Hampton in: Web Hosting Web servers Software

phpmyadmin dump

Question: I have a shared hosting account but need to import a 3GB MySQL database. I do not have shell access, and phpMyAdmin always times out. How can I restore it?

Answer: You can use a script called BigDump to import your dumped MySQL database a little at a time. This will prevent it from timing out when PHP has an imposed limit. According to their site, this script is for people who want:

“To restore the very large backup of your mySQL database (or a part of it) into the new or the same mySQL database. You can’t access the server shell and you can’t import the dump using phpMyAdmin or any other scripts due to hard memory resp. runtime limit of the web server. ”

BigDump is free software released under the GNU General Public License.

Photo: Flickr

Continue reading: Restoring a huge MySQL database

....
share this 0 comments

Changing the MySQL root password

By Tavis J. Hampton in: VPS & Dedicated Web servers Software

MySQL mints

Question: How do I change my MySQL root password on my dedicated server?

Answer: If you have never set the password for MySQL, the server will allow you to connect as root without any password at all. This is obviously not secure and needs to be fixed. Consider it an important step in configuring your server for the first time.

To setup the password for the first time, type this from the command line:

mysqladmin -u root password 54321

Replace “54321″ with your desired password.

To change the password after it has already been set, enter the following:

mysqladmin -u root -p ‘oldpassword’ password 54321

Replace ‘oldpassword’ with your actual password and 54321 with the new one.

Photo Source: Flickr

Continue reading: Changing the MySQL root password

....
share this 0 comments
Network Blogo