Install and set up MySQL - ndgriffeth/Class-Notes-and-Lectures GitHub Wiki

Official instructions and reference manual: http://dev.mysql.com/doc/refman/5.6/en/index.html

See Chapters 1 and 2.

The following instructions are an abbreviated version of the above. This is what worked for me on my particular systems.
They may work for you and be quicker to use, but you will understand less! If these instructions don't work, post an issue (the circled ! to the right) and go back to the source.

Mac OS X

  1. Download the appropriate version of MySQL Community Server from http://dev.mysql.com/downloads/
    for your Mac OS X operating system. Use the 32 or 64 bit DMG archive, depending on your computer.
    Double-click on the dmg file. There are two "pkg" files in the DMG finder page. You will install both.

    Install both mySQL and MySQLStartupItem (remember to right-click and open, double-click won't work). First double-click the community server pkg; after following the instructions for the install, double-click the startup item pkg.

    Finally, double-click the PrefPane item. You will see the status of the server (should be started).

    If MySQL has not started, try the command

      sudo /Library/StartupItems/MySQLCOM/mySQLCOM start
     

    from the command line.

    You can also set the MySQL root password from the command line:

     mysqladmin -u root password 'yourpasswordhere'
     

    You really should set the password

  2. Download MySQL Workbench from http://dev.mysql.com/downloads/.
    Double-click on the dmg and follow the instructions to move the workbench to Applications.

    You can run MySQL Workbench now. Create a Server Instance under Server Administration Connect to server under SQL Development

Ubuntu

My download of Ubuntu 12.04 already had mysql installed, server version 5.5. The standard configuration starts up with a mysql server already running.

If yours doesn't, follow instructions at: http://dev.mysql.com/doc/refman/5.6/en/linux-installation-native.html. Look for Debian/Ubuntu/Kubuntu.

It can be very simple:

 sudo su
 Password:
 apt-get install mysql-server
 apt-get install mysql-client

MySQL Workbench is equally easy:

 apt-get install mysql-workbench

I'm not that great with the Ubuntu GUI, but to run MySQL Workbench I went to Dash Home (the upper left-hand item in the dock) and typed MySQL. THe only Application that showed up was MySQL Workbench, so I selected that, and it started!

Windows XP

Follow instructions at: http://dev.mysql.com/doc/refman/5.6/en/windows-installation.html

I used the noinstall version because I don't have an msi installer on my system. I suspect the install is much easier with the msi installer.

I didn't use an option file.

To avoid the option file:

I created a directory C:\Program Files\MySQL\MySQL Server 5.6
I extracted the downloaded MySQL into it  
         The uncompress program added a directory to the "MySQL Server 5.6" directory, named
         "mysql-5.6.12-win32", and containing the MySQL files.   If yours does this too, move them up to 
         the "MySQL Server 5.6" directory.

Manual pages that should be useful:

    2.3.5.1 Extracting the Install Archive
            If this section says to put the files in "C:\mysql", ignore this -- it's inconsistent with 
            the rest of the instructions -- see above.
    2.3.5.2 Creating an option file: to determine default locations of files.  
            I didn't use this, because I used the standard locations and didn't create the option file.
    2.3.5.3 Selecting a MySQL Server Type: can choose between mysqld and mysqld-debug.  
            I recommend mysqld-debug if you have a new, fast processor; otherwise mysqld.
            Both versions are available with the standard download and install, you choose one at runtime.
    2.3.5.4 Starting MySQL Server on Microsoft Windows for the First Time
    2.3.5.5 Starting MySQL Server from the Windows Command Line: This also tells you how to stop it.
    2.3.5.6 Customizing the PATH for MySQL Tools: Be very, very careful!!
            This can affect every application you have, so do it right
    2.3.5.7 Starting MySQL as a Windows Service: the recommended way to start MySQL
            So far, I haven't been able to get this to work.  First, it couldn't find the executable to 
            run the service.  So I copied the executable, along with all the files in bin whose names
            start with mysqld, to the directory it expected them to be in.  Then it could find it, but
            I got a message that it terminated unexpectedly.  I'm waiting for suggestions or inspiration.            
    2.3.5.8 Testing The MySQL Server Installation on Microsoft Windows

Testing the installation (see 2.3.6.8, immediately above this).

Make sure the mysql server is running (see above for how to start it, I can only do it manually).

"mysqlshow" responds:

 +--------------------+
 | Databases          |
 +--------------------+
 | information_schema |
 | test               |
 +--------------------+

"mysqladmin version" responds

 Server version		        5.6.12
 Protocol version		10
 Connection			localhost via TCP/IP
 TCP port			3306
 Uptime			        3 min 57 sec

If mysqld is running, "mysql" starts a server client and lets you access the database.

Installing MySQL Workbench

See Chapter 4 of the MySQL Reference Manual: http://dev.mysql.com/doc/workbench/en/wb-installing.html.

You're on your own on this one, my ancient Thinkpad is way below the minimum hardware requirements for MySQL Workbench.

⚠️ **GitHub.com Fallback** ⚠️