Automatic installation of MySQL on Windows. How to install MySQL on Windows - lower the temperature of your pot Mysql installation on windows server

) is one of the most used open source DBMS (Database Management Systems). The Community version is distributed under the terms of the GPL license.

Let's start the installation. Run the installation package (mysql-essential-5.0.51b-win32.msi). The default settings are quite normal (the DBMS server will be installed in C:\Program Files\MySQL\MySQL Server 5.0). After installation is complete, leave the “Configure the MySQL Server now” checkbox enabled. The MySQL Server Configurator will launch.

Click Next.

In this dialog, select "Detailed Configuration".

Then there are three options to choose from: “Developer Machine”, “Server Machine” and “Dedicated MySQL Server Machine”. As you can guess from the descriptions, the first option specifies to consume minimum memory, the second - for average consumption, the third - for maximum. If you are installing servers on a home computer that you use, for example, for games, then leave the first option; if you install servers on a separate computer (for example, you have two of them and you want to allocate the second one for the server), then select the second option. You are unlikely to need the third option (it is needed for dedicated DBMS servers).

On the next page you select the available database engines. The MyISAM engine is faster, but does not support transactions, and InnoDB is a little slower, but does support transactions. However, if you are not going to develop your own web applications, then this should not worry you too much. Select "Multifunctional Database" to enable both engines.

In the next dialog, you select where to store the InnoDB tables (this step will only happen if you selected the first or second option in the previous step). The default storage location is fine.

In the next step you set the number of simultaneous connections. The first option is 20, the second is 500, the third is your number. Note: 20 connections does not mean that only 20 users can access your site at the same time. The script's session with the database lasts a maximum of a couple of seconds, so users on the site are not constantly connected to the database. This is something like distributing processor time between programs. The first option is quite enough.

On the next page - server network settings and SQL mode. Leave the settings as default.

The next step is to select the default encoding. I prefer to set the default encoding to utf8 - this is the second option. You can also select the third option and set the encoding to cp1251. Anyway, as far as I know, most CMSs specify the encoding explicitly when creating tables, so you'll need this if you're going to develop your own web applications.

The next dialog is the MySQL service settings. Leave everything here as default.

In the next step, set a password for the superuser (root). Initially, access to the database from outside is prohibited for the superuser (the corresponding checkbox is disabled on this page). So, a long password is not so necessary here. But in any case, security is not the last thing, so set some password. In any case, then we will create another user. Do not set the “Create An Anonymous Account” option - this is harmful from a security point of view.

That's it, now click Execute. The settings will be applied. Click Finish to complete the setup.

Next we will install the MySQL GUI Tools package. This is a very convenient set of utilities for MySQL server administration from the DBMS developers themselves. I personally prefer GUI Tools over phpMyAdmin. If you don't want to use MySQL GUI Tools and prefer phpMyAdmin, you can skip this step.

Launch the installer (mysql-gui-tools-5.0-r12-win32.msi). The default settings are quite satisfactory. After installation is complete, the utilities can be accessed from the Start menu. Launch MySQL Administrator.

In the “Server Host” field enter localhost, in the “Username” and “Password” fields - root and the password that you set in the configurator, respectively. Click OK. The following window will appear:

You can see what is responsible for what here in the article, “Working with MySQL in MySQL GUI Tools.”
Go to the “Catalogs” page. A list of databases will appear below. Right-click on an empty space in it and select “Create New Schema” from the menu. Enter a name for the new database, for example SiteForum. A new database will be created. Now we will set the user and access rights for it. Go to the “User Administration” page.

Click the "Add new user" button. In the MySQL User field, enter forumuser, for example. You can enter something in the “Password” field, or you may not enter it. There is no need to enter anything complicated. Go to the "Schema Privileges" tab. In the list on the left, select the newly created database - siteforum. A list of privileges for this database will appear in the right list. You can choose all privileges. Then click the "<» (или «<<» для переноса всех привилегий). Теперь привилегии пользователя установлены, вы можете нажать кнопку «Apply changes».
That's it, the server is ready to work. Now, when installing a forum, select the siteforum database and the forumuser user.

Today we will take a detailed look at the process of installing the MySQL DBMS version 5.6.23 on the Windows 7 operating system; in addition, we will also install the MySQL Workbench 6.2.4 development and administration tool.

Several years ago, you and I already looked at installing MySQL using version 5.5 as an example, but time passes, technologies are developing, new versions are being released, so now it’s time to update your knowledge in the field of MySQL, and specifically in installing this DBMS. And since this site is for beginners, we will consider installation on the Windows 7 operating system with a step-by-step description of the entire process. This material will also be useful for novice database programmers who want to practice writing queries in SQL or just get to know the MySQL database server better. Moreover, the installation process described below will include not only the installation of the server itself, but also the MySQL Workbench developer tool, the Excel plugin “MySQL for Excel”, MySQL Connectors, as well as examples and documentation.

Since in the last article we already touched upon the question of what MySQL actually is, so today we will not focus on this, but will immediately move on to the topic of the material, i.e. installation process and we will start, of course, with where we can get the MySQL distribution for Windows.

Where can I download the latest version of MySQL for windows?

And since we will be installing on Windows 7, it is best to download the MySQL Installer (installer, distribution) which, as we noted above, will include not only the MySQL server but also much more. In order to download, the installer needs to go to the official download page, here it is, since it is recommended to download only from official sources, this, by the way, applies not only to MySQL but to all software.

After you have gone to the page at the bottom, find the block “MySQL Installer 5.6.23” and click “Download”

As a result, the windows installer package will be downloaded, the file mysql-installer-community-5.6.23.0.msi with a size of 282.4 megabytes.

Installing MySQL 5.6.23 on Windows 7

Now let's move on to the installation; to do this, run the downloaded file (installer). But if suddenly you get an error during startup, i.e. window with the following content

then this means that you do not have the required version of Microsoft .NET Framework installed, since for all the components included in this installer to work, you need a minimum client profile of Microsoft .NET Framework 4, we talked in detail about what it is and how to install it in the material about installing Microsoft .NET Framework 4.0. Also, the MySQL Workbench program requires Microsoft Visual C++ Redistributable for Visual Studio 2013, so you need to install it too. By the way, if you do not know what is installed on your system and what is not, do not worry, during the installation process the installer will check your system for the presence of the necessary external components that are needed for the operation of each of the selected MySQL products, and will provide a list of them, and if necessary, you can quickly install them (we will touch on this below).

Note! The installation program language is English, as is the MySQL Workbench program interface.

Step 1

We agree to the terms of the license agreement, to do this, check the appropriate box and click “Next”

Step 2

Then we mark what we want to install, and since we decided to install everything that a novice developer needs, we select the default installation type, i.e. “Developer Default” and click “Next”

Step 3

Next, the installation program will check your system for the presence of the necessary components. You, in turn, need to install these components (i.e. select them and click “Execute”) or click “Next”, but in this case the corresponding components will not work. But, for example, if you don’t need these components, let’s say you don’t use Visual Studio, so you don’t need to install the component. For example, I do not have Microsoft Office and Visual Studio installed on this test computer, so in this case I will not install the listed components; I click “Next”.

A small warning related to the absence of some components, click “Yes”

Step 4

Then the installer will tell us what exactly he will install, we click “Execute”

And so the installation began

After installing all components, the “Next” button will appear and we click it

Step 5

Step 6

And since we are just beginners on the first window, I suggest leaving everything by default, i.e. do not change anything, but immediately click “Next”

Step 7

On the next window you need to come up with a password for the root user, i.e. for the main administrator, also, if you want, you can immediately add other users here, i.e. create them through the “Add User” button, click “Next”

Step 8

Then leave everything as default and click “Next”

Step 9

That’s it, the MySQL server is configured, click “Finish”

Step 10

Now you need to configure test data for the MySQL server, click “Next”

Connect to the server, click first “Check” then “Next”

Step 11

That’s it, the installation is almost complete, click “Next”

And then “Finish”, by the way, if you check the “Start MySQL Workbench after Setup” checkbox, the MySQL Workbench program will start immediately

Launching MySQL Workbench and connecting to the MySQL server

You can launch MySQL Workbench from the Start menu->MySQL->MySQL Workbench 6.2 CE

After starting, you need to select a MySQL server instance in order to connect to it, in our case there is only one (local), we just click on it

Enter the root user password (which we came up with when setting up the server)

And now we have connected to the MySQL server using MySQL Workbench, we see the test databases and can immediately write some SQL queries

I propose to end here, I hope everything was clear. Good luck!

Similar articles:

info-comp.ru

Automatic installation of MySQL on windows

  • Installing MySQL
  • Setting up MySQL

Installing MySQL

Open the distribution download page: http://www.mysql.com/downloads/mysql/

For Win 32 download: windows (x86, 32-bit), MSI Installer Essentials - Recommended

For Win 64 download: windows (x86, 64-bit), MSI Installer Essentials - Recommended

After clicking on the Download button, you will see a registration form, you can skip it by clicking on the link below (“No thanks, just take me to the downloads!”).

Launch the installer and click Next:

Installing MySQL on Windows (1)

Select the installation type Custom:

Installing MySQL on Windows (2)

Selecting components. Here you can change the installation path of the MySQL files (select MySQL Server, click the Change button), as well as the path for storing databases (select MySQL Server Datafiles, click the Change button):

Installing MySQL on Windows (3)

Check the paths and click Install:

Installing MySQL on Windows (4)

The final stage of installation. Check the “Configure the MySQL Server now” option and click Finish:

Installing MySQL on Windows (5)

Setting up MySQL

After installation is complete, the MySQL Server Instance Configuration Wizard starts (you can run it manually from the Start menu -> All Programs -> MySQL -> MySQL Server 5.1 -> MySQL Server Instance Config Wizard). Click Next:

MySQL setup (3)

We select the installation script: Developer Machine - for installation on a home computer (our choice), Server Machine - for installation on a server, Dedicated MySQL Server Machine - for installation on a server completely dedicated to MySQL. These options primarily affect the amount of memory consumed by MySQL:

MySQL setup (3)

MySQL supports two main types of databases (InnoDB - with transaction support and MyISAM - without transactions). Multifunctional Database - support for both types of databases will be installed (our choice). Transactional Database Only - only InnoDB support will be installed. Non-Transactional database Only - only myISAM support will be installed.

MySQL setup (4)

If you selected InnoDB support in the previous step, you can configure the location of the InnoDB data files here:

MySQL setup (5)

Supports simultaneous connections. Decision Support - up to 20 simultaneous connections (our choice). Online Transaction Processing - up to 500 connections. Manual Setting - manually setting the number of connections.

MySQL setup (6)

Check the “Enable TCP/IP Networking” and “Enable Strict Mode” options. We leave the Port Number unchanged - 3306. If you plan to connect directly to the server from other computers, check the “Add firewall exception for this port” option (open the port in the windows firewall).

Setting up MySQL (7)

Select the default encoding. Right now the smartest choice is UTF-8. Select the Best Support For Multilingualism option:

MySQL setup (8)

Be sure to check the “Install as windows Service” option (run as a windows service). Check “Launch the MySQL Server automatically” if you need the service to autostart.

Setting up MySQL (9)

The final stage. Setting the administrator password (root). It's better not to lose this password! I do not recommend checking the “Enable root access from remote machines” and “Create An Anonymous Account” options, because they reduce safety.

How to quickly check the installation?

Open Start -> All Programs -> MySQL -> MySql Server 5.1 -> MySQL Server Command Line Client (a utility for working with MySQL on the command line).

Next, enter the administrator password (root). If the password is correct, you will be taken to the command prompt (mysql>). Enter the command: show databases; (a semicolon at the end is required). As a result, you should see a list of databases (at least two - information_schema and mysql). This means the server is working correctly. Close the command line by executing the exit command.

ATTENTION! To connect to MySQL from PHP, from a server installed on the same computer, you must use 127.0.0.1 as the MySQL server address instead of localhost!!!

The nature of this glitch is not completely clear to me, but it took me half a day to discover it...

What should I do if the automatic installation fails?

Try installing manually from a zip archive.

How to work with databases?

One of the most popular programs (maybe the most popular) for working with MySQL is phpMyAdmin.

Related articles:

www.q2w3.ru

30

First, download the zip archive from the download page http://dev.mysql.com/downloads/mysql/.

Since I have a 64-bit system, I chose: windows (x86, 64-bit), ZIP Archive

We create a directory for installation, let’s say C:\server\mysql-5.6.15, and unpack the contents of the archive into it.

Open the my-default.ini file (in regular Notepad) and make changes:

We delete all contents or comment them out (put a # at the beginning of each line).

Add the lines:

Port=3306 port=3306 #here we write our path to the installation directory basedir="C:/server/mysql-5.6.15" datadir="C:/server/mysql-5.6.15/data" character-set-server= utf8 default-storage-engine=INNODB sql-mode="" explicit_defaults_for_timestamp = TRUE skip-external-locking key_buffer_size = 16M max_allowed_packet = 1M table_open_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_s ize = 512K myisam_sort_buffer_size = 8M

Save and rename to my.ini

Before performing a test run, open the incoming TCP port 3306 in the windows firewall.

Now you need to do a test run:

Open the directory C:\server\mysql-5.6.15\bin

Click: file and select "open command prompt as administrator"

A warning will appear, agree:

On the command line enter:

mysqld --console

And press: Enter

If the connection was successful, you will see the command line prompt: mysql>

Let's move on to the next step - you need to set the MySQL administrator password (root user). There is no password set by default, and this needs to be fixed. In the same MySQL window, enter the following commands:

Let's check the result:

FLUSH PRIVILEGES;

mysql -u root -p

The last step is to start MySQL as a windows system service.

mysqld.exe --install MySQL --defaults-file=”C:\server\mysql-5.6.15\my.ini”

To start the service, open the “control panel”, “system and security”, “administration”, “services”, and manually start the MySQL service:

Or, more simply: “computer management”, select the services and run:

Or even simpler, through the command line open in the installation directory:

To stop we use the command:

And the last option is to reboot.

To remove a service, run the command:

If you suddenly forgot your root password:

First, you need to reset your password and set a new one. To do this you need: 1.Restart the server in --skip-grant-tables mode 2.Set a new administrator password 3.Restart the server in normal mode Now let's talk in more detail about each point. In skip-grant-tables mode, checking access rights and privileges is disabled, in other words, you can connect with an empty login/password and still have all possible privileges.

To start the server in skip-grant-tables mode, the easiest way is to temporarily add the skip-grant-tables line to my.ini in the section

Skip-grant-tables

Then restart the server.

Using the MySQL Command Line (installed with MySQL), go to mysql without a password (in place of the password, just press Enter) and enter the following command:

UPDATE mysql.user SET password=PASSWORD("your new password") WHERE user="root";

We restart the server.

malwselennaiaru.ru

How to install MySQL on Windows - lowering your pot

From the author: one of my friends managed to rip his back during the day when he was installing a new cabinet at home. And then at work I blew my mind when I tried to figure out how to install MySQL on Windows. In general, I couldn’t cure his back, but I saved his mind from “boiling.” Maybe I’ll save some of you from a headache by telling you about installing a DBMS.

Alternative to Denver?

And a counter question may immediately arise: why bother looking for a headache if there is an already assembled and easy-to-install kit that includes your “favorite” DBMS? Right! There is no need to look for headaches where there are none. Now you don't have any problem related to installing MySQL on windows. But it can happen if:

You only need a DBMS, and not the entire set - perhaps you will decide to delve even deeper into the study of MySQL. Well, PHP and the web server will not be in demand yet. When Denver is launched, it turns out that these components of the set will spin on their own, constantly “eating” the power of the computer hardware. This problem is especially acute for outdated laptop PC models. I know what I'm talking about because I've used one for a long time. My old laptop was loaded with a full couple of open tabs in the browser. In general, every percentage of productivity counted.

Installing a newer version - Denver includes the latest version of MySQL, but sometimes the latest version is required. For example, to develop a database for a specific “edition” of the DBMS.

Upgrading the account management system in phpMyAdmin - through this software shell, which is part of the gentlemen's kit, you can work under only one account, which is installed by default. That is, through root with an empty password. But sometimes you need to log into the MySQL server as a different user to test a query, trigger, or stored procedure. Of course, you can do it through the command line, but you want to work “comfortably.”

Creating ADO applications using another server language - no one argues with the fact that “PHP and MySQL are forever”. But there are other server-side programming languages, which may require installing MySQL on Windows 10 or another OS version to develop applications.

In general, there can be many reasons for installing a separate instance of a DBMS on a client machine: I just cited a few of them. Now let's move on to describing the installation process.

Download your copy

The DBMS distribution package on the official developer resource is available for download in two versions:

In the form of an automatic installation package with the .msi extension - we discussed it in one of our previous materials, so we will skip it.

In the form of a binary code, packed in ZIP - this is the option we will use today.

It is also worth noting that I will be installing MySQL on Windows 7, but for all other (more recent) versions of the OS, these instructions are also relevant. Windows is also Windows in Africa. Let's start! Go here and download the desired version of the archive. I have a 32-bit computer architecture, so I download the archive for this version of the operating system.

The next step will ask you to register, but you can do without it. To do this, click on the link below (marked in the screenshot). After which the downloading of the archive will begin. Please note that its size is more than 300 “meters”. And such a volume for a limited “3G” Internet may turn out to be unaffordable. And in terms of speed too - it will take about 40 minutes for sure.

After this, create a directory for installation and extract the downloaded archive into it. To avoid confusion in the future, it is better to install MySQL 5 6 in Windows directly to drive C.

Editing the configuration file

Now we find the my-default.ini file in the folder and open it using Notepad. Now let's start editing the parameters of our future DBMS server. First, we register the paths to the main directory and the folder where the data will be stored. We also indicate the port and encoding:

Basedir = "C:/Users/home/Documents/MySQL 5.6" datadir = "C:/Users/home/Documents/MySQL 5.6/data" port = 3306 character-set-server=utf8

Then we write down the values ​​of several main variables. Their detailed description can be found in the documentation for the DBMS.

Default-storage-engine=INNODB explicit_defaults_for_timestamp = TRUE skip-external-locking

We will continue installing MySQL 5 6 in Windows 7 by specifying the volumes for all buffers and clearing the sql_mode parameter from the specified value:

Then rename the file to my.ini and save it. After that, go to the bin folder and run the command line as administrator. Enter the following command into it:

mysqld –console

Press “Enter” and the data and connection parameters should be displayed on the screen. Without closing this window, we launch another one (in CMD). Then we log into the server as root with an empty password, which is set by default:

Mysql -u root

We check the correct connection and installation of the database server. To do this, display a list of all databases available on it.

We're done. It is worth noting that installing MySQL 5 5 on Windows 7 is approximately the same, so these instructions are applicable for this version of the DBMS. I hope I was able to lower the boiling point of your “pot” at least a little. Well, if you broke your back while moving the closet, then look into it. Maybe someone is hiding there.

The latest IT and web development news on our Telegram channel

webformyself.com

Manual installation of MySQL on windows

58

Let's start installation:

1. Download the MySQL zip archive from the download page: http://www.mysql.com/downloads/mysql/.

For Win 32, select the distribution: windows (x86, 32-bit), Zip-Archive.

For Win 64: windows (x86, 64-bit), Zip-Archive.

After clicking on the Download button, you will see a registration form, you can skip it by clicking on the link below - No thanks, just take me to the downloads.

2. Create an installation folder. For example C:\Program Files\MySQL\MySQL Server 5.5. And unpack the contents of the archive into it so that the bin, data, docs and other folders are in the root of the installation folder.

3. Let's move on to creating a configuration file (my.ini). We take one of the standard files as a basis:

  • my-small.ini - suitable for those who use MySQL from time to time and do not want the server to take up a lot of resources.
  • my-medium.ini is also a low-resource configuration, but is suitable for those who use MySQL on a regular basis (a good choice for a home web server).
  • my-large.ini and my-huge.ini - for systems used as a dedicated MySQL server. However, my-large.ini can be used for a home server if you need additional MySQL performance (512 MB of RAM is not so much in these days).
  • my-innodb-heavy-4G - for dedicated servers with at least 4 GB of RAM and using only InnoDB tables.

In this example, I chose my-medium.ini as the basis. Rename it to my.ini and place it in the root of the installation folder (C:\Program Files\MySQL\MySQL Server 5.5).

Open for editing (in regular Notepad) and immediately after the line add two parameters:

Basedir=C:/Program Files/MySQL/MySQL Server 5.5 datadir=C:/Program Files/MySQL/MySQL Server 5.5/data

Note that paths use forward slashes (/) rather than backslashes (\).

basedir is the path to the installation folder.

datadir - path to the data folder (where all databases are stored). Sometimes it makes sense to put data on a separate disk to improve performance or ensure reliability.

Just in case, here is a fragment of the configuration file after making the changes:

# The MySQL server basedir=C:/Program Files/MySQL/MySQL Server 5.5 datadir=C:/Program Files/MySQL/MySQL Server 5.5/data port = 3306 socket = /tmp/mysql.sock skip-external-locking key_buffer_size = 16M max_allowed_packet = 1M table_open_cache = 64 sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M

4. The next step is to add the path C:\Program Files\MySQL\MySQL Server 5.5\bin to your PATH environment variable to make it easier to launch MySQL from the command line. To do this, open System Properties -> Additional system settings -> on the Advanced tab, at the very bottom, the “Environment Variables...” button. In the window that opens, scroll through the system variables until we find Path. Select this line and click “Change...”. At the end of the line we add our path, preserving the existing parameters:

Changing PATH

Note that paths are separated by semicolons. Make sure there is a semicolon at the beginning and end of your path.

5. Before performing a test run, open the incoming TCP port 3306 in the windows firewall:

Open TCP port 3306

If you have an additional firewall installed on your system, you must also open TCP port 3306 for incoming connections.

6. Now we carry out a test run. In the command line launched as administrator (this is required if UAC is enabled on Seven or Vista), run:

Mysqld --console

Several lines will be displayed on the screen. If the launch was successful, the last line will look something like this:

Version: "5.5.9-log" socket: "" port: 3306 MySQL Community Server (GPL)

Leave this window open, and open another command line window, in which we enter:

Mysql -u root

If the connection was successful, you will see the command line prompt: mysql>

Let's see what databases we have:

Show databases;

The semicolon at the end of the SQL query is MANDATORY!

Team response:

MySQL Command Line

Now we are finally convinced that the server is working.

7. Let's move on to the next step - you need to set the MySQL administrator password (root user). There is no password set by default, and this needs to be fixed. In the same MySQL window, enter the following commands:

Use mysql UPDATE user SET password = PASSWORD("your_password") WHERE user = "root";

Let's check the result:

SELECT user, host, password FROM user;

Users table

As you can see in the screenshot, the password column is filled, which means the password has been set.

Before exiting, run the command:

FLUSH PRIVILEGES;

Now, when connecting, you must enter a password. To do this, use the -p switch:

Mysql -u root -p

To shutdown MySQL run:

Mysqladmin -u root -p shutdown

8. The last step is to launch MySQL as a windows system service.

Make sure there are no active MySQL processes on the system.

In the command line running as administrator, run:

"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --install

The path to mysqld must be specified in full (even if it is listed in PATH)!

To start the service, open “Computer Management” and manually start the MySQL service:

Starting the MySQL service

Or easier via the command line:

Net start mysql

To remove a service, first stop it:

Net stop mysql

and execute:

"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" --remove

In the previous article we talked about how to use Windows 8/2012. Today we will show you how to install a database management system on Windows 2012 / Windows 8 MySQL. In the future, databases running on our MySQL server can be used to store data used in PHP web server scripts. In particular, most popular CMS sites and online stores use MySQL databases to store their data.

Note. MySQL– one of the most popular DBMS at the moment, it is open and distributed under the GPL license. MySQL is widely used in web technologies, small and medium-sized applications. It is a free alternative to MS SQL and Oracle in solutions where high performance and fault tolerance are not required from the DBMS, and ease of deployment and maintenance is prioritized. MySQL is a cross-platform DBMS, therefore it can run both on *nix-like systems and on the Windows platform. MySQL can be installed both on the Windows Server server platform and on client operating systems, such as Windows 8.

As in the previous article, to install MySQL we need a universal installer Microsoft Web Platform Installer (Web PI). Using Web PI greatly simplifies the deployment and initial configuration of various web platform components.

The latest version currently available is Web PI 5.0 - you can download it from http://www.microsoft.com/web/downloads/platform.aspx

Let's run the downloaded file wpilauncher.exe, go to the tab Productsd and in the search field we indicate MySQL. From the list of products, select the desired version of MySQL (for example, MySQL Windows 5.1), click Add And Install to start the installation.

Important. To install products using Web PI, the system must have Internet access.

The installer will then download and install the appropriate version of MySQL for Windows.

The WebPI installer automatically registers and starts the MySQL service as a Windows system service. The service is started through a separate daemon mysqld. The MySQL service configuration file is used my.ini from the directory C:\Program Files\MySQL\MySQL Server 5.1\.

Let's check the operation of MySQL on Windows through the server command shell by running the mysql.exe file. After startup, you must specify the root password. If the correct password is specified, the mysql command prompt will open.

Information about the MySQL server version, encoding, uptime, TCP port used, etc. can be obtained using the command

mysql>status

The list of databases on the MySQL server can be obtained with the command

mysql> show databases;

By default, two service databases are created on the server: information_schema and mysql.

Let's create a new MySQL user:

mysql> CREATE USER "winitpro"@"localhost" IDENTIFIED BY "Str0ngPwd";

Let's create a new database and grant the previously created user rights to it:

mysql> CREATE DATABASE tstdb;

mysql> GRANT ALL ON tstdb.* TO "winitpro"@"localhost" IDENTIFIED BY "Str0ngPwd";

To allow connecting to the MySQL database from another computer, run the command:

mysql> GRANT ALL ON testdatabase.* TO "winitpro"@"192.168.100.23" IDENTIFIED BY "password";

where 192.168.100.23 is the IP address of the client, which can be remotely connected to the database on the MySQL server.

Advice. For remote connections between the client and server, TCP port 3306 must be open (check that this rule is enabled in Windows Firewall).

Close the MySQL command shell with the command:

Advice. For more convenient management of MySQL databases from the graphical interface, you can install MySQL Workbench (http://dev.mysql.com/downloads/workbench/).

To remove the MySQL service from the system, we will use the command (the command does not remove the DBMS itself).

Installing MySQL never causes problems both on the Windows platform and on 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 chances in which the standard installer will not work as expected are negligible, but even if they happen, you can try installing a different version, double-checking the my.ini file and simply allowing access to port 3306, which is usually the cause of the problems.

Using MySQL in real projects will necessarily lead to the need to work with the server command line and solve administrative problems:

  • users;
  • Database;
  • speed of work;
  • query optimization;
  • data migration, etc.

When creating large web projects, you will need to use fine-tuning MySQL and manage its functions in full. When the website reaches the level of a high-load resource, you will need to adjust and test my.ini - the configuration of the data management system.

In the Windows environment, there are often cases when it is difficult or simply impossible to import a database using convenient tools (for example, phpMyAdmin), but everything can always be done using the command line.

If once the server is installed and working perfectly, then the first reason for this problem is the my.ini settings (my.cnf for Linux users).

Traditions and features of operating systems

The MySQL installation can be performed on a different port (standard - 3306), and therefore there is no need to demolish what is already installed.

“Magic” packages and repositories in Linux are a guarantee of continuous updating with an extremely clear movement towards the goal: under no circumstances should the system give in to 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 can always help him.”

Based on these circumstances, over time, garbage from installations/uninstallations of programs accumulates in the depths 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, so any installation of critical software must be performed using surgically precise methods on an absolutely prepared system.

The MySQL installation is preceded by uninstalling the previous installation:

  • sc;

and installing packages:

  • vcredist_x64;
  • vc_redist.x64.

Uninstalling the previous version is done from the command line in administrator mode. It is not always possible to remove a previous installation in the Add or Remove Programs section. It is not enough to simply stop the service or clean the registry.

Installing MySQL on Windows

The process poses no problems for either a professional or a beginner. The basic rule that you should trust and follow during installation: MySQL works reliably and flawlessly.

Auxiliary rule: you should rely on installation from a zip archive and your own efforts. Using the loyal and "do-it-yourself" MySQL installer is only for familiarization with the subject and process.

Only when installing using MySQL Installer will it be possible to uninstall the product in the “Add or Remove Programs” section.

Installing Apache, MySQL, PHP on Windows is a process that has been proven for centuries. Everything always works stably, reliably, efficiently. If something goes wrong, it means there is an error in the configuration or initialization files, the hosts file has been unfairly forgotten, a conflicting application is running, or there are problems from a previous installation (service, registry).

Fast start

The first step: download the zip archive of the required version from the official website. The latest one for today is 5.7.21 and unzip it.

Second step: select the drive and folder in which the DBMS and its databases will be located. It's best to install Apache, MySQL and PHP in one place. But this circumstance is absolutely not important. A different solution will simply create difficulties in executing real projects. Access to the folders of these products will be necessary from time to time and remembering where everything is installed is a waste of time.

Third step: write the “my.ini” file. This is a very important file, but a sample like this is a good place to start:

An important circumstance: you can find a ton of my.ini samples on the Internet. It is important to look at the date of the proposed option. The world is changing so quickly that old versions of important files do not always correspond to the latest versions of programs.

Clarifying the MySQL position and installation

After the zip archive is unzipped, it should be supplemented with the following folders:

  • scFiles;
  • scLog;
  • scTmp;
  • MySQL_DBs (most important!).

The names of these folders can be anything, but the installation package must include a location for importing/exporting files, a location for the log, a location for temporary files, and a folder where the MySQL databases will be located.

Once everything is ready, you should launch the command prompt in administrator mode and run only two commands. Please note: 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 prompt in administrator mode to set the user password - root.

A temporary password is created and displayed on the screen upon the first command. You should write it down so you don't have to repeat the process again. In this example, the temporary password was oRJiT%Im5eBA.

After these three commands, the server “started”, but is 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.

Final stage of installation

The MySQL installation is complete, to create the root password, run the command prompt again in administrator mode (2).

In the second window, enter -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 temporary string that was issued earlier. In this case: oRJiT%Im5eBA.

The only first and correct command is to set 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 complex. Be sure to write the symbol ";" at the end of the command. - this is a team! This symbol is required.

The screenshot shows adding two more administrators and giving them full management rights to the installed MySQL system.

This completes the procedure; it is no more complicated than installing MySQL on Ubuntu, CentOS, FreeBSD or another Linux version. It should be noted that the Windows installation option 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 own developers, its own direction of development. MySQL has 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 for a developer (programmer). The ability to install LAMP and navigate all the parameters of configuration files is very important.

Excellent programming in PHP is not possible without solid knowledge of the language itself, the MySQL and Apache database management systems. 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 for optimal operation is a sought-after knowledge and skill.


Direct link: mysql-5.5.23-win32.msi
Download the self-extracting archive "Windows (x86, 32-bit), MSI Installer" and run it.

Installing MySQL in pictures

Next, those dialog boxes will be shown in which you need to make some choices.

Click in this window to install custom components "Custom".

Now let's start setting up the MySQL server.

Select the detailed setting - "Detailed Configuration".

Check the box "Developer Machine". We are developers, right? :)

By selecting the "Multifunctional Database" item, you will be able to work with both InnoDB type tables (with the ability to use transactions) and high-speed MyISAM (as a rule, this type of table is used for web development).

Selecting a disk and directory for storing InnoDB tables.

In this dialog box, you select the maximum possible number of connections to the MySQL server. If you select "Decision Support (DSS)/OLAP", the maximum number of connections will be limited to twenty, which is more than enough when installing the server on a home computer and there is not a large number of simultaneous connections.

By checking "Enable TCP/IP Networking" we enable support for TCP/IP connections and select the port through which they will be made. The standard port for the MySQL server is 3306. By checking “Enable Strict Mode”, we set the mode to strictly comply with the SQL standard (it is recommended to leave this option enabled).

Pay attention to the settings in this window. By checking “Manual Selected Default Character Set / Collation” and selecting “cp1251” from the drop-down menu, we determine that initially the Cyrillic Windows encoding (cp1251) will be used for the tables, which means that it will work correctly with the Russian language in this encoding.

If you check "Install As Windows Service", the server will start as a service, which is the recommended way to start it. Below, in the drop-down list, specify the name of the service. Next, uncheck the box next to "Launch the MySQL Server automatically" - we will launch the server manually. Also check the box next to "Include Bin Directory in Windows PATH" - this will make the "bin" directory visible to the command line.

Set the user password to "root". I advise you to do this. Enter at least some simple password, just don’t leave the field empty, this will save you from possible troubles in the future.

In this window, pay attention to the line “Write configuration file”, which indicates the location - “my.ini”, then you will need to edit it a little.


Open the "my.ini" file for editing.
  1. In the section, after the line:
    port=3306
    Add a line defining the directory containing encoding description files:
    character-sets-dir="C:/Program Files/MySQL/MySQL Server 5.5/share/charsets"
  2. In the section, after the line:
    port=3306
    Add the following two lines, the first of which you already know, the second sets the encoding in which the data is transmitted to MySQL:
    character-sets-dir="C:/Program Files/MySQL/MySQL Server 5.5/share/charsets"
    init-connect="SET NAMES cp1251"
  3. Next, find the line:
    default-storage-engine=INNODB
    Replace the initially installed table type with MYISAM:
    default-storage-engine=MYISAM
Save your changes and close the "my.ini" file.
Installation and configuration of the MySQL server is completed.


What else to read