Archive for MySQL Web Hosting

Adding and Dropping MySQL Users via SSH

Most of the webmasters uses GUI (Graphical User Interface) in order to manage their databases, though it is a web based tool such as phpMyAdmin or the MySQL Administrator which is a desktop tool. But, for a system administrator, it is much more convenient to use simple mysql commands via the command line interface.

Using the single mysql commands string a webmaster can easily add users and drop users from the MySQL database.

Step 1: Log-in to your server via SSH

Step 2: Enter the following command to login to the MySQL command interface.

# mysql -u -p  (For Eg: mysql -u joe_dbname -p password)

Once you enter the above command it will ask you for the username and password. Simply type the mysql username and password and hit the Enter button. If the login credentials are correct, the shell prompt will be replaced with the MySQL prompt:

mysql>

Step 3: In order to add a user to the MySQL, enter the following mysql command string:

mysql> CREATE USER user@host IDENTIFIED BY ‘password’;

Don’t forget to replace the “USER” by the username you wish to create and “host” by the server IP.

Step 4: In order to drop or remove a user from the MySQL, enter the following mysql command string:

mysql> DROP USER user@host;

782x50 5

 

Related Posts:

  • No Related Posts

Options for MySQL Database

Almost all the websites on internet are built using the server-side scripting, hence, it is very much predicted for dedicated servers to have some form of database management system, either it can be a database server or a set of database libraries. MySQL is one of the world’s most popular open source Relational Database Management Systems (RDBMS). It is a most important part of the LAMP (Linux, Apache, MySQL, PHP) family. Customers opting for cheap web hosting services, will possibly expect the latest version of MySQL installed on the server. However, if you have your own server, you might want to take a look at the following choices for MySQL database.

MySQL Database Alternatives

MariaDB is a database software created by the MySQL founder, Michael Widenius (often called Monty), by bifurcating the MySQL software after the Oracle acquired Sun. MariaDB is a completely free and open source version which includes some unique features and functionality.

PostgreSQL is one of the rivals of MySQL. It is an object relational database management system (ORDBMS) providing various appealing features and high-level performance.

SQLite is a kind of relational database libraries, which doesn’t need a database server. These libraries are completely portable and simple to use, even in those situations where full database servers are not possible.

Cassandra is an open source Apache project originally designed and developed by Facebook Inc. It is also known as a NoSQL solution, that offers greater scalability and several appealing features that makes it ideal for high traffic and high content websites, which is being used by sites like Digg.

If you search you will find plenty of alternatives to MySQL database with many appealing features and functions. Though MySQL is known as one of the most popular database in the uk web hosting market, but it is surely not the only one.

Related Posts:

Backup / Restore IPB Forum MySQL Database on Dedicated Server

I would not suggest you to use PHPMyAdmin to backup and restore your Invision Power Board MySQL database as this may time out. On your dedicated server hosting account, if your hosting company has provided you command line access, then its better to use it to back and restore IPB MySQL database. Following are the steps to backup and restore your IPB Forum Database in Linux.

On your Linux Dedicated Server, you can use any command line tool via SSH to make a database dump by running the command given below. Make sure you replace the “username, password and databasename” with actual details that you have created when setting up your Invision Power Board forum.

mysqldump -uusername -ppassword databasename > databasename.sql

(Always put the “-u & -p” before the username and password as shown above).

You can compress the above backup, in order to transfer it round more easily. Run the following commands to compress it.

tar -cvpzf databasename.tgz databasename.sql

To decompress the compressed backup, run the following command into the command line.

tar -xzvf databasename.tgz

The backup file will be extracted in this form: “databasename/databasename.sql“.

To Restore the IPB MySQL database, run the following commands through your command line on your dedicated web server.

mysql -h localhost -uusername -ppassword databasename < databasename/databasename.sql

If you are running the command from a different directory, you will have to adjust the above command line.

782x90 5

That’s it! You have successfully, backed up and restored your Invision Power Board (IPB) forum database using command line on your dedicated server. Now you know how to backup, compress, decompress and restore your IPB forum database. It’s always better to know how to backup and restore your forum database.

Related Posts:

  • No Related Posts

Secure PHP Hosting

Secure PHP Hosting

Security is the utmost importance to us but sometimes security is relied solely on you, the Customer. If you create your own PHP applications; maybe you’re a new PHP developer, you’ll need to take into consideration security of your PHP applications. Some of them include:
• SQL Injections
• HTML & Javascript vulnerabilities in MySQL database values.

Note that all of these vulnerabilities are caused by the programmers themselves in their PHP applications and are not vulnerabilities with the PHP software itself. These vulnerabilities could be prevented in modifications to the PHP configuration but that would mean that 90% of all PHP scripts would probably stop working properly. This is because the 90% of scripts that keep their code secure without the PHP config modification would do the complete reverse and stop working if the config was changed. So this really is an unviable solution for us so therefore it is down to the programmer themself to keep their applications secure. Below we’ll explain about the many vulnerabilities that especiially affect forms used in conjuction with PHP interactivity.
• SQL Injections
This is a big issue and is probably the most lovable thing about PHP to hackers – and it can do disasterous effects to your scripts. SQL injections are where hackers compromise MySQL features in your SQL statements which change the way statements look when executed with a MySQL query. An example being a MySQL comment in a form. Let’s say you had a member system – a hacker could add a MySQL comment to the password field and they’d not need a password at all! If you think logically the SQL statement would be like just SELECTing the username, right? Well the SQL comment does add an AND clause for the password but the value is actually commented out, therefore MySQL accepts it as correct login credentials. To prevent this happening you’d use the mysql_real_escape_string() function which slashes single or double quotations therefore preventing a SQL injection altogether. If you think about it, if the query is like this:

SELECT * FROM `users` WHERE `username` = ‘$value’ AND `password` = ‘$value’

If you slash ‘ it would prevent the value being escaped therefore preventing injections.
• Code in Forms
Imagine you’ve got a form and that form will be submitted to a database and later on retrieved from. If the user adds HTML or even Javascript (which is worst) the user may be able to add redirects or even cause worser attacks using the POST method of the form. If you think about it, a user could be happily submitting data via a form but doesn’t realise there’s a silent Javascript redirect that has a PHP file that’s holding the same POST variables of that page (such as $_POST, $_GET or simply $_REQUEST) and therefore the user’s data is captured quite easily on the external site. To prevent this you can use a variety of options, such as:
• htmlspecialchars() function that turns opening and closing brackets into HTML entities (so it would actually display the brackets and code on the page, instead of parsing it).
• strip_tags() function is a more less-user-friendly option which strips the brackets and HTML/JS code completely.
• preg_match() function is where you can see if the form values have brackets in them and if so refuse the post.

htmlspecialchars syntax: htmlspecialchars($_POST['message'])
strip_tags syntax: strip_tags($_POST['message'])
preg_match syntax:
$str=$_POST['message'];
$look=”/ $look1="/>/”;
if(preg_match($look,$str) || preg_match($look1,$str)) {
echo “Match found!”;
}

For more information you should check out the PHP documentation for list of functions and their uses and explanations at php.net.

Related Posts:

SQL Web Hosting

SQL Web Hosting

SQL web hosting can come in the form of either MySQL database hosting or Microsoft SQL Server database hosting since both are examples of high end SQL servers used by large corporations and individuals alike to run database driven websites. SQL database servers are used for the storage of large volumes of data since basic desktop database systems such as Microsoft Access are unable to cope with the demand that large websites and applications can put on them in terms of work load. SQL web hosting is designed for those who want to host large corporate websites that need to store dynamic content in one central location in the form of an SQL database. SQL databases can be integrated into a variety of websites, just as long as the website concerned has been coded in a server side language that support the use of a server side SQL database hosting technology; you will also need to ensure that the web hosting server on which you are hosting is able to cope with hosting an SQL database server, and that the necessary server side sofrware components are installed to allow the interaction.

The average desktop database system, such as Microsoft access is only file based, meaning that it is strictly limited to the amount of data that it is able to store. Also, since a Microsoft Access database is seen as a file when being used in conjunction with a website and isn’t run through a service like Microsoft SQL Server and MySQL databases are, meaning that SQL based database servers are much more scalable than your average desktop database system. This means that if you are planning on running a large website on a Microsoft Access database, you may want to think again; SQL database hosting services are also able to offer you other benefits such as web administration and remote access using freely available database administration programs. Desktop database systems require that you have their software installed on your local computer to allow you to manage the database remotely, meaning that you have to pay for the program before you can even think about setting up a database. In the case of Microsoft SQL Server 2005 Express hosting and MySQL server hosting, you don’t have to pay for the right to use either service since they are both free.

SQL web hosting services are perfect for those who wish to integrate some sort of SQL database into their dynamic server side website. MySQL web hosting is normally provided on a Linux operating system, meaning that it is mostly used in conjunction with websites that have been designed and built using Linux based scripting languages such as PHP and Perl. Both PHP and Perl contains components that allow you to connect them to MySQL databases, and in turn can interact with the database itself and carry out actions which typically were restricted to a management console. Web hosting providers also offer Microsoft SQL Server 2005 web hosting which allows developers who have built their websites using classic ASP and ASP.NET to allow their websites to interact with an SQL database. With either MySQL or Microsoft SQL Server database hosting, you are storing the data that your website needs in one central location meaning that it can be accessed by any of the web pages that you have hosted on your SQL web hosting package.

php asp net logo

Although web hosting providers offer control panels for SQL web hosting, these control panels often contain pieces of third party software to allow you to manage your SQL database easily using a web based interface rather than a desktop program. Web hosting providers offering MySQL web hosting will provide you with access to the cPanel control panel to manage your main web hosting account, although you can use the integrated PHPMyAdmin web interface to allow you to manage your hosted MySQL databases from any internet connected computer that has a web browser installed. Those who wish to use Microsoft SQL Server database web hosting will find that their web hosting provider has provided them with access to the Plesk control panel to manage the main parts if their SQL web hosting account. The Plesk control panel comes with the ASP.NET Enterprise Manager which is the application you can use for web based administration of your Microsoft SQL Server hosted databases. SQL web hosting control panels are important, especially for those who travel around alot; this is because the management of your SQL database is important.

phpmyadmin logopleskcpanel logo

SQL web hosting
is an enterprise level web hosting service since in the case of Microsoft SQL Server 2005 web hosting, the costs can be high since licensing bodies such as Microsoft charge businesses alot of money for the right to use one of their products. MySQL web hosting on the other hand is a cheaper form of SQL web hosting since it is an open source application meaning that web hosting provdier’s aren’t charged by any individual or company for the right to use the application commcercially. SQL database hosting is seen as a reliable form of database hosting since databases are served through a service rather than as a straight up file meaning that there is more room for them to be controlled before they are attached to the main page that is requesting them. Another factor that can help make SQL web hosting reliable is that you can have your own dedicated server setup to run the SQL web hosting service of your choice, meaning that you will not only have the reliability of the dedicated server that you can trust but you can also reliable on the service to stay up and not crash on you.

microsoft sql server 2005 mysql

SQL web hosting services normally require high end web hosting servers to take the load since most websites utilizing SQL web hosting services get many visitors meaning that a basic shared web hosting server wouldn’t be able to cope with the high load. Since server hardware is getting cheaper, web hosting providers are now using the highest specification servers available for SQL web hosting but at the same time are dropping the prices that they are charging for their Microsoft SQL Server and MySQL server web hosting packages to bring in more customers. Since SQL web hosting services are getting cheaper, more webmasters are now migrating their websites over to using SQL based database services since it means that their websites will be more reliable, thus increasing the overall uptime of the website concerned. Since reliability is an issue with web hosting these days, using a separate SQL hosting server is paramount to ensure that your server doesn’t become overloaded with requests.

Most web hosting companies expect SQL web hosting customers to have a reasonable level of knowledge with regards to SQL web hosting, since webmasters that are running SQL based dynamic websites and applications normally have a high level of programming knowledge that can help them out with database server administration. Web hosting providers that do provide support for SQL web hosting customers normally only cover the basics such as issues with the SQL hosting server or if one of your scripts or web pages is unable to interact with a database that you have hosted on the SQL web hosting server.

support person2

In conclusion, SQL web hosting is perfect for those who wish to host a website that is based on a dynamic server side scripting language and needs to interact with an SQL database in order for it to function correctly. If you find an SQL hosting package that is able to provide you with the level of support you need, then you’re set; however, you need to bare in mind that most SQL hosting packages are specialised meaning that your web hosting provider will expect you to have some sort of previous knowledge about SQL web hosting services.

Related Posts:

« Previous entries Next Page » Next Page »