This tutorial will teach you how to install and run MySQL through your terminal in Windows, Ubuntu, or Mac.
- On the following page scroll down and click: “No thanks, just start my download”.
- Run the MSI file accepting any permission prompts.
- Click accept on the license agreement:
- Select Developer Default and hit next.
- You will most likely have some warnings on the Check Requirements page, that is okay. Select “Next” and then confirm the warning.
- Your Installation page should look similar to this: Select Execute.
- When the install is done it should look similar to this: The failed status on Connector/ODBC is okay.
- Next the installer walks you through configuring your MySQL server. On “type and Networking” page leave everything as is:
- Give the account a root password. You can also create a new user here, or leave it empty and use root when you login.
- On the following page “Windows Service” you can once again leave everything in the default state:
- On the “Apply server Configuration” page select Execute, then select Finish once the configuration is done.
- Next the installer will configure Samples and Examples:
- User and Password should be filled in for you on the Connect To Server page, select check, and then next:
- Select Execute and then finish, then next, and then Finish. MySQL should now be Installed.
- From the start menu run MySQL 5.6 Command Line Client -Unicode:
- Type in your root password and you are now in mySQL.
Mac OSX (Yosemite):
From the mysql site Download Mac OS X 10.9(x86, 64-bit), DMG Archive:
and on the following page select “No thanks, just start my download” at the bottom of the page.
- Open the dmg and double click on the package and you should get this dialogue box:
- Press continue twice, and agree to the license
- Do the standard install, or change the location to your preferred directory, and click install.
- Once you run the installation, you may get a pop up saying the install failed. Don’t worry the install worked.
- To start the server run the following command in your terminal:
sudo /usr/local/mysql/support-files/mysql.server start
- You now want to edit you PATH to make it easier to open mySQL use your preferred text editor to edit your .bash_profile from your home directory and add:
- Then in a terminal source the file:
- You can now run mysql in a terminal with the command:
- And you can set the root password with:
/usr/local/mysql/bin/mysqladmin -u root password 'yourpasswordhere'
- And now you can log in to mysql as root with:
mysql -u root -p
- In your terminal run sudo apt-get update:
sudo apt-get update
sudo apt-get install mysql-server-5.6
- Enter “Y” when prompted and shortly you will see this configuration box, select ok:
- Type in the root password you would like to use for the new mysql root account:
- And confirm the password in the next prompt.
- You should now be able to run mysql with the following command:
mysql -u root -p