MySQL can be installed and run easily on windows after the Windows 10 Anniversary Update which includes Bash on Ubuntu on Windows feature. In order to install MySQL, you will first need to install the Bash on Ubuntu on windows feature. If you haven’t done so by now, please follow the following tutorial under the requirements below.
If you are not running the Windows 10 Anniversary Update or Windows 10 Creator Update, please follow one of the following tutorials:
If you are running Windows 10 Anniversary Update but haven’t installed the Bash on Ubuntu on Windows feature, please follow the following tutorial:
You can also check the following tutorials:
To do this, click on start (or press the Windows key) and type “Bash on Ubuntu on Windows” then click on it to start using the shell.
If you are not running bash as root, please type:
If prompted to enter the password, please do so.
You need to use the Linux command apt-get in order to install the MySQL server or any other package.
If you want to install only the MySQL server without the Apache mod or php for MySQL, type the following:
apt-get install mysql-server
If you want to install the MySQL server and both the Apache mod and php for MySQL, type the following:
apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
During the installation, a package configuration page will appear. Enter the MySQL administration “root” password and hit enter. The page will ask you to confirm your password. Type your password again and hit enter.
When asked to continue, type “Y” and hit enter.
Start MySQL server by typing the following:
service mysql start
You can use the “mysql” command to start the MySQL client. Type the following:
mysql -u root -p
If asked for the password, type it and hit enter. If everything is Ok, the client will connect you to the MySQL server.
Create your first database “test1” by typing the following and hit enter:
create database text1;
To show the current databases, type the following:
This command will show you all of the databases available, including “test1” database.
To exit the client, type the following and hit enter: