Installing MySQL on a Linux server – is a very simple procedure, which won’t take you longer than 5 minutes (including after-installation setting).
Before installing MySQL
- The latest versions of MySQL by Oracle Company cannot boast either operating speed or stability; however, there is an excellent substitution – MariaDB. This is a free instance of MySQL, from the author of MySQL, fully compatible with MySQL. If you have no special reasons for installing MySQL by Oracle itself, then, I recommend you installing MariaDB. We have a detailed article on installing MariaDB: How to install MariaDB on Linux server - a guide.
- In case you require a server with Apache+PHP+MySQL, there is no need to install MySQL separately. Install Webmin all at once, and in about 5-10 minutes you will get a ready server for web hosting or programming. You will find more details in our article: How to install Webmin and Virtualmin on any Linux server.
- If you haven’t chosen a server yet, I recommend using affordable and high quality virtual servers by DigitalOcean. A minimal server costs 5$ per month, you will be given 10$ as a gift for registration (proceed to DigitalOcean hosting).
The instruction is sized for Linux distro CentOS, but will be suitable for many others as well. Why CentOS? It’s solid, reliable and free – which makes it perfect for web servers.
1. Run a command:
yum install mysql-server
The YUM packet manager will offer you to install MySQL server itself and supporting software. Reply “y” and click Enter button.
2. Installation will take a few seconds; MySQL server, libraries and client will be installed. If you require additional libraries, for example, PHP support – you can install them separately:
yum install php-mysql
That’s it, MySQL has been installed, now you can perform its initial setting.
3. To define or alter root password for MySQL, run a special script:
Follow the instructions, everything is quite simple there.
If you have any questions or need more details – please, ask a question or leave a comment. I always will be pleased to help you!