What is MySQL & why do I need it?

mysql – what is it In the early days of the Internet, websites used a static code – in this case, all the content and other information for displaying it is firmly embedded in an HTML document.

This means that any change must be made on a large number of documents in order to update even a simple text. For this reason, dynamic websites are preferred today, where the information is stored in a MySQL database.

Table of Contents

What are the advantages of web hosting with a MySQL database and PHP?

A database is mandatory for content management systems (CMS). Besides MySQL, some support formats such as SQLite, where the database is stored in a file. However, with MySQL, information is located in memory, which significantly increases performance. The processing speed of the data in turn affects the speed of the PHP interpreter and therefore leads to an increased Server Response Time (SRT) and a delayed page load in case of slow access. For this reason, MySQL or MariaDB should always be preferred as a database over other formats, if possible. In almost all cases, paid web hosting is combined with a MySQL database. However, in the case of free hosting, this may have to be purchased as a paid option.

What is MySQL and how is it used?

MySQL is one of the oldest database systems and has been under continuous development since 1994. It is a relational database with a syntax reminiscent of a programming language, where tables and data can be read, modified or created using a simple command. However, it is only necessary for users to work directly with the database themselves in exceptional cases. Instead, this task is performed by PHP scripts, which read and manipulate the database via their embedded statements. The output is then – as with the configuration or the user interface of a CMS – via web pages with a graphical user interface. For direct work with a database, there are also graphical utilities such as phpMyAdmin, written in PHP, which allow manual access.
What advantages does MySQL offer over other databases?

MySQL has become one of the most popular database systems over the past decades and is the default choice for most CMSs. Its advantages include:

  • Open source code under open source license
  • Free version allows free use in commercial projects
  • Support for various purpose-optimized engines (storage systems)
  • High performance even with large amounts of data
  • Extensive support by applications and a large community
  • Stability in productive systems
  • Server-client architecture allows the operation of numerous databases
  • No direct limit on the size of tables and databases

These features make MySQL ideally suited for applications such as dynamic web pages, where efficient syntax and high responsiveness are important. Therefore, in combination with its free availability, web hosting with MySQL database has established itself as an unofficial standard. It is often combined with a Linux operating system, PHP and an Apache web server and in this combination is also known as LAMP (Linux, Apache, MySQL, PHP) or, if nginx is used, as LEMP.

What is the difference between MySQL and MariaDB?

After the company responsible for the development MySQL AB was taken over by the Oracle group in 2010, numerous leading programmers criticized that the open source version was neglected compared to the commercial version. This led Michael Widenius – one of the founders of MySQL AB and its lead developer – to leave the project and start a fork based on the open source code. He named this fork (like MySQL before) MariaDB after one of his daughters. MariaDB is fully compatible in syntax and allows (almost always) a complication-free migration from one system to another.

However, MariaDB has some features that are reserved for the commercial version of MySQL. While the migration to MariaDB therefore does not cause any conflicts, a return is not possible without adjustments. In the meantime MariaDB has become widely accepted and is used as standard by popular Linux distributions like Debian, Ubuntu, OpenSUSE, Arch, Fedora or Slackware. More info can be found in our MySQL vs. MariaDB comparison.

What information does the MySQL database store?

In a web hosting with MySQL database, it serves as a central instance where content required by PHP scripts is stored. These include:

  • Texts including headings, meta tags and forms.
  • Users such as customers, administrators, moderators or registered users
  • Rights to manipulate and create new content
  • Passwords for different accounts
  • External and internal links
  • Links to required files like images, videos or audio
  • Contents of menus or buttons
  • Email addresses

Sensitive data such as passwords are not stored by MySQL and MariaDB in their plain text, but are encrypted beforehand by the PHP scripts using secure methods such as One-Way-Encryption. It is not possible to decrypt the password. Therefore, the security of a web hosting with MySQL database and PHP is guaranteed even in case of a database theft, provided that secure passwords with a certain length and special characters have been used.