1 Download and Extract The Zip File

Choose the zip file according to your Windows architecture, 32 bit or 64 bit. In this tutorial, I use the 64-bit version. Then, on the next page, if you don’t want to login/register just click the link No thanks, just start my download

Next, extract the zip file we have downloaded. In this example, I extract it to a directory of E:\mysql-5.7.17 The extracted files look like the following figure:

2 Add a data Folder and Create a Configuration File

Next, we need to create a folder that will be used for MySQL to place the database files and all correspondent data files such as data tables, stored routines, etc.

On MySQL version 5.6 and earlier, all of the data files are stored by default in a data folder, which is already included in the zip file that we downloaded.

However, starting from MySQL version 5.7, that folder has been removed and now, we are free to choose the name and the location of the folder.

For simplicity, we name the folder data and we place it in the main folder (E:\mysql-5.7.17). In Addition, we also need to create a configuration file named my.ini

3 Add Some Parameters

Next, we need to add some parameters to the my.ini file. These parameters will be used by MySQL to perform various configuration at runtime.

For simplicity, copy and paste the contents of the my-default.ini file into the my.ini file, then, open that file with notepad (or notepad ++). Next, under [mysqld] section, add the following parameters:

In addition, we store all MySQL error to mysql_error.log file, otherwise, MySQL will automatically create a file with extension of .err to handle the error message, this also happened to the pid_file and socket configuration file

4 Initialization For The First Time

Furthermore, to be able to run MySQL, first, we need to initialize it. We run this process only once.

This process will create necessary files and databases that used to run MySQL including making a username and optionally a password and set privileges to the user.

There are two statements that we can use to initialize (we must choose one)

mysqld --initialize
or
mysqld --initialize-insecure

The Difference is: mysqld --initialize will create a random password that written to the log file, in this example mysql_log.log file located in the data folder.

While for mysqld --initialize-insecure, there is no password to be set, Nevertheless, we can still create a password later.

By default, the process will create a user to login with root as the username, we can define another username by adding --user option, e.g. mysqld --initialize-insecure --user=agusph

For simplicity, in this example, we will initialize using the default username ( root ) without a password. Open a command prompt and navigate the cursor to the bin folder, then, run the command mysqld --initialize-insecure

Wait for a while until the process complete, if successful, the data folder will contain files and folders as shown in the following figure:

5 MySQL is Ready To Use

At this step, MySQL is ready to use. To be able to use MySQL, we need to run the MySQL server. Open a command prompt and type the command mysqld, if successful, the cursor will not return to E:\mysql-7.5.17\bin, as shown below:

If the cursor back to E:\mysql-5.7.17\bin then some errors has occurred, to solve it, see section II at the bottom of this tutorial.

Now, you can close the command prompt window, although closed, the MySQL server will still running (exists in Windows Task Manager on Processes section).

At this step, we can now use MySQL using root as the username without a password. We can try it using a command prompt or database management application such as phpMyAdmin, HeidiSQL, or Toad for MySQL.

Let’s try with the command prompt. Open a command prompt and then point the cursor to E:\mysql-7.5.17\bin, then type the command mysql -u root

If successful, the pointer will change to mysql> such as the following

6 Shutdown The MySQL Server

Mysql server that has been started, will still live until we turn it off manually or we restart our computer. The MySQL server can be seen in the Windows Task Manager (in Windows 7+ press Ctrl+Shift+Esc)

To turn it off, we can use the command mysqladmin -u root shutdown as follows:

If it already turned off, and we run the command, we’ll get an error message like the following:

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to MySQL server on 'localhost' (10061)'
Check that mysqld is running on localhost and that the port is 3306.
You can check this by doing 'telnet localhost 3306'

II. Install MySQL Zip File – Handling Error

Sometimes, the installation process did not run in smooth, some error may occur and some of them known when we run the MySQL server using the mysqld command.

As we have discussed previously, if we run mysqld and the cursor back to the bin directory E:\mysql-5.7.17\bin then it signs that some errors have been occurred, for example:

To discover the cause of the error, open the error log file, in this example mysql_error.log file, then find the messages that contains ERROR word, eg:

In the example above, the error occurs because incorrect type of the command option –initialize-unsecure, while it should be --initialize-insecure (using i, instead of u),

To solve that, we have to run the command again mysqld --initialize-insecure, Note that before executing the command, we have to empty the data folder

Or it could be like this:

means that port of 3306 has been used, there could be another MySQL that run using that port. In the real world, the type of error can be vary, always check the error log file to investigate the error.

In this tutorial, we have discussed how to install MySQL zip file on windows, hope it help.

Subscibe Now

Loves articles on webdevzoom.com? join our newsletter to get quality article right to your inbox. Nothing else, just quality stuff!!!

Our Commitment: We respect your privacy, we'll not share your credential to any party

Ok, you just hit the target. The reasons for the question was that i was trying to conmect my Dreamweaver to my database on my Phpmyadmin. But its returns an error message similar to what you just said. This is the error message

“Your PHP server doesn’t have the MySQL module loaded or you can’t use the mysql_(p) conmect functions”.

Please i have been stock here for weeks, Trying all suggestion and solutions, yet no positive achievement. Do you know what might cause this? My server is running fine and everything seems ok. Exception of this error message.

From the error message, it seems that your PHP version doesn’t support mysql_xxx function. That function depends on MySQL module located in the php/ext folder. phpmyadmin try to use musql_xxx function but fail, so that it raised an error.

As of PHP 7 and above, that function was removed and replaced by mysqli_xxx instead, so the module doesn’t exist anymore…

I have a form for login system but whenever i test it on my local server and click the login page, its responds well but when i click sign up, i get this error.

Notice: Undefined variable: _user in C:\xampp\htdocs\phpacademy\register.php on line 7
Notice: Undefined variable: _user in C:\xampp\htdocs\phpacademy\register.php on line 8
Notice: Undefined variable: _user in C:\xampp\htdocs\phpacademy\register.php on line 9
Notice: Undefined variable: mysqli in C:\xampp\htdocs\phpacademy\register.php on line 12
Fatal error: Call to a member function escape_string() on null in C:\xampp\htdocs\phpacademy\register.php on line 12.

Perfect and clear! In my.ini I had to use absolute paths to make it work. I did not manage to disable it using the command mysqladmin -u root shutdown:
C:\mysql57\bin>mysqladmin -u root shutdown
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘root’@’localhost’ (using password: NO)’
I should install the service?
Thank you

C:\mysql\bin>mysqld –initialize-insecure
mysqld: [ERROR] Found option without preceding group in config file C:\mysql\my.ini at line 1!
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!

mysqld: Could not create or access the registry key needed for the MySQL application
to log to the Windows EventLog. Run the application with sufficient
privileges once to create the key, add the key manually, or turn off
logging for that application.
2018-04-11T07:56:12.586473Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use –explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-11T07:56:12.589846Z 0 [ERROR] Cannot open Windows EventLog; check privileges, or start server with –log_syslog=0
2018-04-11T07:56:12.596154Z 0 [ERROR] –initialize specified but the data directory has files in it. Aborting.
2018-04-11T07:56:12.596551Z 0 [ERROR] Aborting

I have mysql 5.0.22 with myISAM databases, and i wanted to upgrade it to mysql 8. I used the ZIP method and configured the new version with mysqld –initialize, but with an empty data folder (as i had an error when putting my old myIsam databases in it : 2018-07-24T07:59:03.592367Z 0 [ERROR] [MY-010457] [Server] –initialize specified but the data directory has files in it. Aborting.).
The mysql service started successfully.
Then, i put my database files in the data folder and run mysql_upgrade, i douln’t recover them, neither recover old users.
How to recover my myISAM databases please ? Anyoune can help me please ??

Hi, thank you very much for your feedback. I write the tutorial honestly and not intended to lie visitors to get traffic, so please let me know what information did you search for until you land to this page