Setup & Basics of MySQL

Download MySQL:

Go to mysql.com, click on “Developer Zone” then click on “MySQL Downloads”, then click on “MySQL Community Server” .. or go to https://dev.mysql.com/downloads/mysql/

Click on “Go to Download Page”

Select the one labeled Web, for online, or the one without Web in the name for offline installation, ex: mysql-installer-web-community-8.0.17.0.msi

You might have to give some registration info, at least you’ll need your real email address to verify an email they’ll send you.

Save & Run it.

Download the following, at least:

  • MySQL Server, x64 or x86 depending on your OS, go back a few releases if it fails, based on different Visual C++ or Visual Studio installations, such as an Alpha Build or a previous Major Version. Versions 8.0.15 and newer and the most useful and least limited versions of MySQL
  • MySQL Workbench, x64 or x86, select a similar version as your server, or close to it
  • MySQL Notifier, usually only x86
  • MySQL for Excel, usually only x86
  • MySQL Utilities, x64 or x86
  • MySQL Shell, x64 or x86
  • Connector/C++, x64 or x86
  • Connector/J, usually only x86
  • Connector/NET, usually only x86
  • MySQL Documentation, usually only x86
  • Samples & Examples, usually only x86

Set up your Server with a Strong Password, using the default port and most of the default settings, and let it start running. I suggest not selecting the option which allows it to run at Start up.

Go to My Computer > Properties > Advanced System Settings > Environmental Variables > System Variables > path > and click Edit…

Navigate to your MySQL Server Bin Folder, such as C:\Program Files\MySQL\MySQL Server 8.0\bin and copy the location path, then paste it into the edit window and click OK three times.

Click on the MySQL Notifier in your Windows Notification Tray and go to Actions > Options and deselect Run at Windows Startup, then click Accept.

 

Create your First Database File:

Open a Windows Command Prompt

Type: mysql -u root -p

(-u is the user, we’re setting to root user, and -p is to input your MySQL Password)

Type in your password

Type: CREATE DATABASE myfirstdatabase;

Always end MySQL commands with a Semicolon, and hit enter, or name it to whatever name you want other than myfirstdatabase

Type: show databases;

and you can see the database you created listed there.

Congrats!

 

Program Info:

Type \q to exit

Stop your Servers by clicking on MySQL Notifier in your Windows Notification Tray, Click on the Server & select from Stop, Start, or Pause

Your Databases are stored in [installdive]:\ProgramData\MySQL\MySQL Server X.x\Data

ProgramData is a hidden folder, so you may need to be sure you are set to View Hidden Files & Folders in your View Settings

The Configuration file for your server is named “my.ini”, and can be found in [installdive]:\ProgramData\MySQL\MySQL Server X.x

 

If you want to read an SQL Dump File:

First create a new database as you did above, with whatever you want your dump to be named

Put the dump *.sql file in the MySQL Server Bin Folder that you found above when setting Environmental Variables

Open a Command Prompt from the Bin Folder (If you use File Menu Tools, you can just right click in the folder > File Menu Tools > Open a Command Prompt from Here)

Type mysql -u root -p newdatabasenameyoucreated < nameofyourdumpfile.sql

using the name of the database you created to be made from the Dump.

 

To View Databases in Excel:

Go to Excel > Ribbon > Data Tab > MySQL for Excel

Double Click on your server & enter your MySQL Password

In the Side Bar, Open the “Tables” Title

Shift + Click to select top to bottom, or Ctrl + Select the ones you want to open & Select Import

If you are unsure which table has the most important data, you can go to [installdive]:\ProgramData\MySQL\MySQL Server X.x\Data, then click on the folder with the same name as you named your database, and look for the .idb file with the largest file size, then go back into Excel and select that Table Title, then click Import

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s