Installing MySQL never causes problems on both the Windows platform and the entire Linux family. On the official website you can find MySQL Installer, answer all its questions and instantly get a working database management system.
MySQL Installation Features
The options in which the standard installer does not work as intended are negligible, but even if they happen, you can try to install another version, double-check the my.ini file and simply allow access to port 3306, which is usually the cause of problems.
The use of MySQL in real projects will necessarily lead to the need to work with the server command line, to solve administrative problems:
- users
- Database;
- speed of work;
- query optimization;
- data migration, etc.
When creating large web projects, you will need to use the fine-tuning MySQL and fully control its functions. When the website approaches the bar of a highly loaded resource, you will need to adjust and test my.ini - the configuration of the data management system.
In the Windows environment, there are cases when it is difficult or simply impossible to import a database using convenient tools (for example, phpMyAdmin), but you can always do everything with the command line.
If the once installed and perfectly working server went down, then the first reason for this problem is my.ini settings (my.cnf for Linuxoids).
Traditions and features of operating systems
MySQL installation can be performed on a different port (standard - 3306), and therefore, there is no need to demolish what is already standing.
“Magic” packages and repositories in Linuxoids are a guarantee of continuous updating with an extremely clear movement toward the goal: under no circumstances should the system panic.
The ability to install, update and remove, even automatically, any software in the Windows environment when moving in the direction of “we know what the user needs and we can always help him”
Based on these circumstances, over time, garbage from installing / uninstalling programs accumulates in the bowels of operating systems, many of them leave traces in system registries, important files, and hang in work processes.
Few people want to reinstall the operating system, because any installation of responsible software must be performed surgically by exact methods on an absolutely prepared system.
The MySQL installation is preceded by the removal of the previous installation:
and installing packages:
- vcredist_x64;
- vc_redist.x64.
Removing the previous version is done from the command line in administrator mode. It is not always available to remove the previous installation in the “Add or Remove Programs” section. It is not enough just to stop the service or to clean the registry.
Install MySQL on Windows
The process is not a problem for either a professional or a beginner. The basic rule that you should trust and follow during installation: MySQL works reliably and impeccably.
Ancillary rule: you should rely on the installation from the zip archive and your own strengths. Using a loyal and “stand alone” MySQL installer is only for getting to know the issue and the process.
Only during installation through MySQL Installer will it be possible to remove the product in the "Add or Remove Programs" section.
Installing Apache, MySQL, PHP on Windows - a "worked out" process for centuries. Everything always works stably, reliably, efficiently. If something goes wrong, then there is an error in the configuration or initialization files, the hosts file is undeservedly forgotten, the conflicting application is working, there are problems from the previous installation (service, registry).
Fast start
First step: on the official website, download the zip archive of the desired version. Last today 5.7.21 and unzip it.
The second step: select the drive and folder in which the DBMS and its databases will be located. Best of all, when installing Apache, MySQL and PHP are done in one place. But this circumstance is absolutely not fundamental. Another solution will simply create difficulties in the implementation of real projects. Access to the folders of these products will be necessary from time to time and remembering where everything is installed is an extra waste of time.
Third step: write the file “my.ini". This is a very important file, but a sample like this is a good start:
This file content allows you to start the server without any problems. If you leave only an indication of the MySQL folder and its data folder, the server will also start, but it does not look to plan and design my.ini at the beginning of the installation. Too many parameters, and understanding their use without practice is not a very promising idea.
An essential circumstance: on the Internet you can find a ton of my.ini samples. It is important to look at the date of the proposed option. The world is changing so fast that old versions of important files do not always correspond to the latest versions of programs.
Refining MySQL and Installing
After the zip archive is unzipped, it should be supplemented with folders:
- scFiles;
- scLog;
- scTmp;
- MySQL_DBs (the most important thing!).
The names of these folders can be any, but the installation package should be equipped with an indication of the place to import / export files, a place for the log, a place for temporary files and a folder where the MySQL databases will be located.
After everything is ready, you should run the command line in administrator mode and run only two commands. It should be noted that the commands are executed in the bin folder of the MySQL package, in the place where it is placed.
The procedure does not take much time, but after the mysqld --console operation completes, the command line hangs. You should run the second command line in administrator mode to set the user password - root.
A temporary password is created and displayed on the first command. It should be written down so as not to repeat the process again. In this example, the temporary password was oRJiT% Im5eBA.
After these three commands, the server "became", but not ready for work: MySQL - appeared in the list of services. You need to set a password for root, add a couple of administrators and restart the computer.
The final stage of installation
MySQL installation is complete, to create the root password, the command line in administrator mode (2) is launched again.
In the second window, the command is entered : mysql -u root -p. This is where the server is called, not its daemon. You will be prompted to enter a password: you need to enter the time line that was issued earlier. In this case: oRJiT% Im5eBA.
The only first and correct command is setting a password for root:
- ALTER USER 'root' @ 'localhost' IDENTIFIED BY 'sc';
Instead of 'sc', you should write the desired password, taking into account security requirements, that is, not two simple characters, but something more or less complicated. Be sure to write the symbol ";" at the end of the command - this is a team! This symbol is required.
The screenshot shows the addition of two more administrators and transfer to them full control rights of the installed MySQL system.
This completes the procedure, it is no more complicated than installing MySQL on Ubuntu, CentOS, FreeBSD or another version of Linux. It should be noted: the installation option for Windows is a simple use of a powerful tool for creating and using databases.
Time-tested quality
MySQL has virtually no competition. It so happened: its own niche, its developers, its own direction of development. MySQL occupies its own place in the "registry" of popular database management systems, ideal for small and large projects.
Installing Apache, MySQL and PHP on a local computer is a kind of qualification attribute of a developer (programmer). The ability to install LAMP and navigate all the parameters of the configuration files is very important.
Excellent programming in PHP is not real without reliable knowledge of the language itself, MySQL and Apache database management system. And knowledge of "httpd.conf", "php.ini" and "my.ini" is important and significantly affects the speed, quality and reliability of development.
Installing MySQL in conjunction with Apache and PHP is a good practice; setting it up to the optimal mode of operation is in demand knowledge and skill.