KwikSteps

StepsHow to setup MySQL server on Bash on Ubuntu on windows

by

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.

Article Image

Requirements

  • Windows 10 64-bit
  • Windows 10 Anniversary Update
  • Bash on Ubuntu on Windows feature

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:

Tools and commands used

  • Bash on Ubuntu on Windows shell
  • apt-get shell command
  • service shell command
  • nano editor
  • mysql command

You can also check the following tutorials:

Step 1: Run the Bash on Ubuntu on Windows shell

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:

su root

If prompted to enter the password, please do so.

Step 2: Download and install MySQL server using apt-get

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.

Step 3: Start the MySQL server using the service command

Start MySQL server by typing the following:

service mysql start

Step 4: Test the MySQL server using the mysql command

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:

show databases;

This command will show you all of the databases available, including “test1” database.
To exit the client, type the following and hit enter:

quit
Comments (0)
Load comments
Post your comment
*Name:
Email:
*Comment:
Post Comment
logo203X28
Copyright © 2017
KwikSteps
- All Rights Reserved.
Thank you!
Namecheap.com