Normally, I would download MySQL msi installer for windows and install then configure and created the database within the installation steps. Then just connect using whatever application/language and go from there.
However
I want to reach the same result without using the msi installer, instead i want to use the provided MySQL archive.
So,
- I have downloaded (MySQL Community Server => Windows (x86, 64-bit), ZIP Archive mysql-5.7.17-winx64.zip)
- Extracted the archive.
I want to know how to create and manage a database using those downloaded server files through windows command line.
Most of the search attempts yield results that either assume that msi installation have taken place or are far too complex for someone who is still attempting to learn MySQL basics.
TL;DR : How can i create and manage a database using MySQL server archive files on windows through command line?
In addition to that, if you encounter the "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." error - Add to the steps 6, 7 the following line: --log_syslog=0
Thanks to Ryan Vincent's comment. I was able to follow the steps in MySQL's reference documentations (For some reason my searches prior to asking this question never found it).
Reference Documentation : 2.3.5 Installing MySQL on Microsoft Windows Using a noinstall Zip Archive
Simplified Steps
D:\mysql\mysql-5.7.17-winx64
)D:\mysql\mydb
)D:\mysql\logs
)Create MySQL options file (example location :
D:\mysql\config.ini
)[mysqld]
groups options relating to mysqld.exe which will be used when mysql.exe reads this configuration file.[mysqladmin]
groups options relating to mysqladmin.exe which will be used when mysqladmin.exe reads this configuration file.Initialize MySQL database files using Windows Batch File/Command Prompt
Create a batch file to start the MySQL database server
[mysqld]
part/group of the configuration file (D:\mysql\config.ini
) and use options specified there to start the MySQL database server.Create a batch file to shutdown the MySQL database server
[mysqladmin]
part/group of the configuration file (D:\mysql\config.ini
) and use options specified there to specify and shutdown the MySQL database server.DISCLAIMER Those steps are supposed to help you get started with MySQL database and are in no way intended or secure for production.(root user doesn't even have a password set yet)
Resources And More Details