The 8.0.26 version of Mysql for Mac is available as a free download on our software library. This free software for Mac OS X was originally produced by Oracle Corporation. The file size of the latest installation package available is 418.3 M. MySQL is often deployed in a LAMP (Linux-Apache-MySQL-PHP), WAMP (Windows-Apache-MySQL-PHP), or MAMP (macOS-Apache-MySQL-PHP) environment. All components in LAMP is free and open-source, inclusive of the Operating System. The mother site for MySQL is https://www.mysql.com.
In addition to the core installation, the Package Installer also includes Section 2.4.3, “Installing and Using the MySQL Launch Daemon” and Section 2.4.4, “Installing and Using the MySQL Preference Pane” to simplify the management of your installation.
This article is applicable to MySQL 8.0, which is the successor of MySQL 5.7, where 5 was dropped?!
I also got the same problem in mac OS X 10.10.4(Yosemite).SET PASSWORD work for me.Alter password for mysql- mysql SET PASSWORD = PASSWORD('yourpassword'); Query OK, 0 rows affected, 1 warning (0.01 sec) set your Mysql environment path variable in.bashprofile and add the below line. MySQL is often deployed in a LAMP (Linux-Apache-MySQL-PHP), WAMP (Windows-Apache-MySQL-PHP), or MAMP (macOS-Apache-MySQL-PHP) environment. All components in LAMP is free and open-source, inclusive of the Operating System. The mother site for MySQL is https://www.mysql.com. MySQL Shell is a component that you can install separately. MySQL Shell supports X Protocol and enables you to use X DevAPI in JavaScript or Python to develop applications that communicate with a MySQL Server functioning as a document store. For information about using MySQL as a document store, see Using MySQL as a Document Store. For installation on macOS, including using both the binary package and native PKG formats, see Section 2.4, “Installing MySQL on OS X”. For information on making use of an macOS Launch Daemon to automatically start and stop MySQL, see Section 2.4.3, “Installing a MySQL Launch Daemon”.
A relational database organizes data in tables. A table has rows (or records) and columns (or fields). Tables are related based on common columns to eliminate data redundancy and ensure data integrity.
Popular Relationship Database Management System (RDBMS) includes:
A high-level programming language, called Structure Query Language (SQL), is designed for interacting with the relational databases. SQL defines a set of commands, such as SELECT
, INSERT
, UPDATE
, DELETE
, CREATE TABLE
, DROP TABLE
, and etc.
Edgar F. Codd of IBM proposed the Relational Database Model in 1970. SQL, one of the earlier programming language, was subsequently developed by Donald D. Chamberlin and Raymond F. Boyce at IBM in the early 1970s. Oracle, subsequently, took it to a new height.
ANSI (American National Standard Institute) established the first SQL standard in 1986 (SQL-86 or SQL-87) - adopted by ISO/IEC as 'ISO/IEC 9075' - followed in 1989 (SQL-89), 1992 (SQL-92 or SQL2), 1999 (SQL-99 or SQL3), 2003 (SQL:2003), 2006 (SQL:2006), 2011 (SQL:2011) and 2016 (SQL:2016). However, most of the database vendors have their own directs, e.g., PL/SQL (Oracle), Transact-SQL (Microsoft, SAP), PL/pgSQL (PostgreSQL).
A relational database system organizes data in the following hierarchy:
Suppose we have a database called studentdb
, a table called class101
in the database with 3 columns (id
, name
, gpa
) and 4 rows as illustrated below. Each column has a data type. We choose: INT
(integer) for column id
, VARCHAR(50)
(variable-length string of up to 50 characters) for name
, and FLOAT
(floating-point number) for gpa
.
SQL (Structure Query Language) defines a set of intuitive commands (such as SELECT
, INSERT
, DELETE
, UPDATE
) to interact with relational database system.
SQL is a programming language for interacting with relational databases. On the other hand, MySQL is a software - a Relational Database Management System.
MySQL is one of the most used, industrial-strength, open-source and free Relational Database Management System (RDBMS). MySQL was developed by Michael 'Monty' Widenius and David Axmark in 1995. It was owned by a Swedish company called MySQL AB, which was bought over by Sun Microsystems in 2008. Sun Microsystems was acquired by Oracle in 2010.
MySQL is successful, not only because it is free and open-source (there are many free and open-source databases, such as PostgreSQL, Apache Derby (Java DB), mSQL (mini SQL), SQLite and Apache OpenOffice's Base), but also for its speed, ease of use, reliability, performance, connectivity (full networking support), portability (run on most OSes, such as Unix, Windows, macOS), security (SSL support), small size, and rich features. MySQL supports all features expected in a high-performance relational database, such as transactions, foreign key, replication, subqueries, stored procedures, views and triggers.
MySQL is often deployed in a LAMP (Linux-Apache-MySQL-PHP), WAMP (Windows-Apache-MySQL-PHP), or MAMP (macOS-Apache-MySQL-PHP) environment. All components in LAMP is free and open-source, inclusive of the Operating System.
The mother site for MySQL is https://www.mysql.com. The ultimate reference for MySQL is the 'MySQL Reference Manual', available at https://dev.mysql.com/doc. The reference manual is huge - the PDF has over 3700 pages!!!
MySQL operates as a client-server system over TCP/IP network. The server runs on a machine with an IP address on a chosen TCP port number. The default TCP port number for MySQL is 3306. Users can access the server via a client program, connecting to the server at the given IP address and TCP port number.
Extracted from Wiki: MariaDB is a community-developed, commercially supported fork of the MySQL relational database management system (RDBMS), intended to remain free and open-source software under the GNU General Public License. Development is led by some of the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle Corporation in 2009.
I want you to install MySQL on your own machine, because I want you to learn how to install, customize and operate complex industrial software system. Installation could be the hardest part in this exercise.
IMPORTANT: Before getting started, check that you have a few GBs of Free Spaces.
Create a directory to keep all your works called:
c:myWebProject
'.~/myWebProject
' where '~
' denotes your home directory.Use your graphical interface, e.g., File Explorer (Windows), or Finder (macOS) to verify this directory. (Of course you can use your graphical interface to create this directory!)
For novices: It is important to follow this step. Otherwise, you will be out-of-sync with this article and will not be able to find your files later.
For Windows
mysql-8.0.{xx}-winx64.zip
)'.C:myWebProject
'. MySQL will be unzipped as 'c:myWebProjectmysql-8.0.{xx}-winx64
'. (Right click on the file ⇒ Extract All ⇒ Choose the destination folder as 'c:myWebProject
'.)c:myWebProjectmysql
'. Take note and remember your MySQL installed directory!!!root
is created with a temporary password, as shown above. TAKE NOTE of the PASSWORD, COPY and SAVE it somewhere, and also TAKE A PICTURE!!!C:myWebProjectmysql
', and REPEAT step 2 and 3.For macOS
Notes: The latest version of MySQL (8.0.23) works with macOS Catalina (10.15) and Big Slur (11). If you are running older version of macOS, you may need to find an archived version of MySQL @ https://dev.mysql.com/downloads/ ⇒ Archive.
mysql-8.0.{xx}-macos10.15-x86_64.dmg
). .dmg
' file downloaded.mysql-8.0.{xx}-osx-10.{xx}-x86_64.pkg
'./usr/local/
mysql
'. Take note of this installed directory!!dmg
' file./usr/local
(via Finder ⇒ Go ⇒ GoTo Folder ⇒ type /usr/local
) and remove all the folders beginning with 'mysql...
', e.g., 'mysql-8.0.{xx}...
' and 'mysql
', and Re-run Step 2.For Ubuntu
Refer to 'How to install MySQL on Ubuntu'.
I shall assume that MySQL is installed in directory 'c:myWebProjectmysql
' (for Windows) or '/usr/local/mysql
' (for macOS). But you need to TAKE NOTE OF YOUR MySQL INSTALLED DIRECTORY. Hereafter, I shall denote the MySQL installed directory as <MYSQL_HOME>
in this article.
The MySQL is a client-server system. The database is run as a server application. Users access the database server via a client program, locally or remotely thru the network, as illustrated:
mysqld
' (with a suffix 'd'
, which stands for daemon - a daemon is a non-interactive process running in the background).mysql
' (without the 'd'
).The programs mysqld
and mysql
are kept in the 'bin
' sub-directory of the MySQL installed directory.
For Windows
To start the database server, launch a new CMD shell:
Note: The --console
option directs the output messages to the console. Without this option, you will see a blank screen.
For macOS
The EASY WAY: Via graphical control. Click 'Apple' Icon ⇒ System Preferences ⇒ MySQL ⇒ Start or Stop.
The MySQL database server is now started, and ready to handle clients' requests.
Anything that can possibly go wrong, does! Read 'How to Debug'.
For Windows
The quickest way to shut down the database server is to press Ctrl-C to initiate a normal shutdown. DO NOT KILL the server via the window's CLOSE button.
Observe these messages from the MySQL server console:
For macOS
The EASY WAY: Via the graphical control. Click 'Apple' Icon ⇒ System Preferences ⇒ MySQL ⇒ Stop.
WARNING: You should properly shutdown the MySQL server. Otherwise, you might corrupt the database and might have problems restarting it. BUT, if you encounter problem shutting down the server normally, you may kill the 'mysqld
' process in Task Manager (for Windows); or Activity Monitor (for macOS); or System Monitor (for Ubuntu).
Recall that the MySQL is a client-server system. Once the server is started, one or more clients can be connected to the database server. A client could be run on the same machine (local client); or from another machine over the network (remote client).
To login to the MySQL server, you need to provide a username and password. During the installation, MySQL creates a superuser called 'root
' with a temporary password. I hope that you have taken note of this password! (Otherwise, re-install!)
The MySQL installation provides a command-line client program called 'mysql
'. (Recall that the server program is called 'mysqld
' with a suffix 'd'
; the client program does not have the suffix 'd
').
Let's start a command-line client with the superuser 'root
'.
First, make sure that the server is running. See previous step to re-start the server if it has been shutdown.
For Windows
Start Another NEW CMD shell to run the client (You need to keep the CMD that run the server):
For macOS
Open a NEW 'Terminal' and issue these commands to start a MySQL client with superuser root
:
(Skip Unless...) Read 'How to Debug'.
As mentioned earlier, the MySQL installation creates a superuser called 'root
' with a temporary random password. 'root
' is a privileged user that can do anything, including deleting all the databases. You are required to change the root's password immediately after logging in.
Notes: If you get stuck entering a command, press Ctrl-C to abort the current command.
Let's continue with our client session started earlier.
We have just changed the password for root
and exited the client. Start a client and login as root
again. Enter the password when prompted.
For macOS
The superuser 'root' is privileged, which is meant for database administration and is not meant for operational. We shall create a new user - let's call it 'myuser
' - with a lesser privilege. To create a new user, start a client with superuser 'root
':
create user
' to create a new user called 'myuser'@'localhost'
, who can login to the server locally from the same machine (but not remotely from another machine), with password 'xxxx
'.select
. We use the 'grant
' command to grant 'all
' the privileges (including select
, insert
, delete
, and so on) to this new user on ALL the databases and ALL the tables ('on *.*
'). This new user, in practice, has the same privilege as root
, except that it cannot issue grant
command. For production, you should grant only the necessary privileges on selected databases and selected tables, e.g., 'grant select
, insert
, update on studentdb.*
' - it can issue select
, insert
and update
(but no delete
, create/drop table
) on ALL the tables of the database studentdb
only.Recall that the MySQL server organizes data in the following hierarchy:
Let's create a database called 'studentdb
', and a table called 'class101
' in the database. The table shall have three columns: id
(of the type INT
- integer), name
(of the type VARCHAR(50)
- variable-length string of up to 50 characters), gpa
(of the type FLOAT
- floating-point number).
CAUTION: Programmers don't use blank and special characters in NAMES (database names, table names, column names). It is either not supported, or will pose you many more challenges.
Before we proceed, here are some tips on using the client:
;
), which sends the command to the server for processing. E.g., ->
to denote continuation. You need to terminate the command with a semicolon (;
). E.g., In other words, if you forget to type ';'
, you can type the ';'
on the next line.c
to cancel (abort) the current command. E.g., '>
or '>
(instead of ->
). For example, Let's start a client with our newly-created user 'myuser
'.
'K'
. (Hints: name like 'K%'
, see Section 'SQL by Examples')'K'
. (Hints: name NOT like ...
)gpa
between 4.35 and 4.65. (Hints: test-1 AND test-2
)'e'
. (Hints: name like '%e%'
)'e'
or 'a'
. (Hints: test-1 OR test-2
)'e'
and gpa ≥ 4.5
.(Skip Unless... ) Read 'How to Debug'.
ABCTrading
'.ABCTrading
' database as the default database.products
' with the columns and type indicated below. Pencil
'.In a bookstore, a book is written by one or more authors; an author may write zero or more books. This is known as a many-to-many relationship. It is IMPOSSIBLE to capture many-to-many relationship in a SINGLE table (or one spreadsheet) with a fixed number of columns, without duplicating any piece of information! For example, if you organize the data in the table below, you will not know how many author columns to be used; and you need to repeat all the data for repeating authors.
The many-to-many relationship between books and authors can be modeled with 3 tables, as shown below. A books
table contains data about books (such as title and price); an authors
table contains data about the authors (such as name and email). A table called books_authors
joins the books
and authors
tables and captures the many-to-many relationship between books
and authors
.
mybookstore
'.mybookstore
' as the default database.books
', 'authors
', and 'books_authors
' in the database 'mybookstore
', with column names and types as shown in the database diagram.title
, price
, qty
) by 'Tan Ah Teck' with price
less than 20
.name
and email
) for the book title 'Java for Dummies'.title
, price
, qty
) and all the authors (name
and email
) for books with title beginning with 'Java' (Hints: title LIKE 'Java%'
).You can use the 'mysqldump'
utility program to back up (i) the entire server (all databases), (ii) selected databases, or (ii) selected tables of a database. The 'mysqldump
' program generates a SQL script that can later be executed to re-create the databases, tables and their rows.
For example, the following command backups the entire 'studentdb
' database to a SQL script called 'backup_studentdb.sql
'.
For macOS
Study the output file, which contains CREATE DATABASE
, CREATE TABLE
and INSERT
statements to re-create the database and tables dumped earlier.
You can restore from the backup by running the 'source
' command in a MySQL client. For example, to restore the studentdb
backup earlier:
For macOS
MySQL commands are NOT case sensitive.
'Everything that can possibly go wrong will go wrong.' The most important thing to do is to find the ERROR MESSAGES!!!
CAUSE: You do not have the required 'Microsoft Visual C++ redistributable runtime'.
SOLUTION: Goto 'The latest supported Visual C++ downloads' @ https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads ⇒ Download 'x64: vc_redist.x64.exe
' ⇒ run the executable to install 'Microsoft Visual C++ 2015-2019 redistributable (x64)' ⇒ Restart your computer ⇒ You can find 'vcruntime140_1.dll
' under 'C:WindowsSystem32
'.
First of all, check if you have already started an instance of MySQL Server:
mysqld
' processes. 'End' all the 'mysqld
' processes.mysqld
' processes. 'Kill' all the 'mysqld
' processes.mysqld
' processes. 'Kill' all the 'mysqld
' processes.No more disk space?!
Table of Contents
noinstall
ZIP ArchiveThis chapter describes how to obtain and install MySQL. A summary of the procedure follows and later sections provide the details. If you plan to upgrade an existing version of MySQL to a newer version rather than install MySQL for the first time, see Section 2.11, “Upgrading MySQL”, for information about upgrade procedures and about issues that you should consider before upgrading.
If you are interested in migrating to MySQL from another database system, see Section A.8, “MySQL 5.6 FAQ: Migration”, which contains answers to some common questions concerning migration issues.
Installation of MySQL generally follows the steps outlined here:
Determine whether MySQL runs and is supported on your platform.
Please note that not all platforms are equally suitable for running MySQL, and that not all platforms on which MySQL is known to run are officially supported by Oracle Corporation. For information about those platforms that are officially supported, see https://www.mysql.com/support/supportedplatforms/database.html on the MySQL website.
Choose which distribution to install.
Several versions of MySQL are available, and most are available in several distribution formats. You can choose from pre-packaged distributions containing binary (precompiled) programs or source code. When in doubt, use a binary distribution. Oracle also provides access to the MySQL source code for those who want to see recent developments and test new code. To determine which version and type of distribution you should use, see Section 2.1.2, “Which MySQL Version and Distribution to Install”.
Download the distribution that you want to install.
For instructions, see Section 2.1.3, “How to Get MySQL”. To verify the integrity of the distribution, use the instructions in Section 2.1.4, “Verifying Package Integrity Using MD5 Checksums or GnuPG”.
Install the distribution.
To install MySQL from a binary distribution, use the instructions in Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”.
To install MySQL from a source distribution or from the current development source tree, use the instructions in Section 2.9, “Installing MySQL from Source”.
Perform any necessary postinstallation setup.
After installing MySQL, see Section 2.10, “Postinstallation Setup and Testing” for information about making sure the MySQL server is working properly. Also refer to the information provided in Section 2.10.4, “Securing the Initial MySQL Accounts”. This section describes how to secure the initial MySQL user accounts, which have no passwords until you assign passwords. The section applies whether you install MySQL using a binary or source distribution.
If you want to run the MySQL benchmark scripts, Perl support for MySQL must be available. See Section 2.13, “Perl Installation Notes”.
Instructions for installing MySQL on different platforms and environments is available on a platform by platform basis:
Unix, Linux, FreeBSD
For instructions on installing MySQL on most Linux and Unix platforms using a generic binary (for example, a .tar.gz
package), see Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”.
For information on building MySQL entirely from the source code distributions or the source code repositories, see Section 2.9, “Installing MySQL from Source”
For specific platform help on installation, configuration, and building from source see the corresponding platform section:
Linux, including notes on distribution specific methods, see Section 2.5, “Installing MySQL on Linux”.
Solaris, including PKG and IPS formats, see Section 2.7, “Installing MySQL on Solaris”.
IBM AIX, see Section 2.7, “Installing MySQL on Solaris”.
FreeBSD, see Section 2.8, “Installing MySQL on FreeBSD”.
Microsoft Windows
For instructions on installing MySQL on Microsoft Windows, using either the MySQL Installer or Zipped binary, see Section 2.3, “Installing MySQL on Microsoft Windows”.
For details and instructions on building MySQL from source code using Microsoft Visual Studio, see Section 2.9, “Installing MySQL from Source”.
macOS
For installation on macOS, including using both the binary package and native PKG formats, see Section 2.4, “Installing MySQL on OS X”.
For information on making use of an macOS Launch Daemon to automatically start and stop MySQL, see Section 2.4.3, “Installing a MySQL Launch Daemon”.
For information on the MySQL Preference Pane, see Section 2.4.4, “Installing and Using the MySQL Preference Pane”.
This article is applicable to MySQL 8.0, which is the successor of MySQL 5.7, where 5 was dropped?!
A relational database organizes data in tables. A table has rows (or records) and columns (or fields). Tables are related based on common columns to eliminate data redundancy and ensure data integrity.
Popular Relationship Database Management System (RDBMS) includes:
A high-level programming language, called Structure Query Language (SQL), is designed for interacting with the relational databases. SQL defines a set of commands, such as SELECT
, INSERT
, UPDATE
, DELETE
, CREATE TABLE
, DROP TABLE
, and etc.
Edgar F. Codd of IBM proposed the Relational Database Model in 1970. SQL, one of the earlier programming language, was subsequently developed by Donald D. Chamberlin and Raymond F. Boyce at IBM in the early 1970s. Oracle, subsequently, took it to a new height.
ANSI (American National Standard Institute) established the first SQL standard in 1986 (SQL-86 or SQL-87) - adopted by ISO/IEC as 'ISO/IEC 9075' - followed in 1989 (SQL-89), 1992 (SQL-92 or SQL2), 1999 (SQL-99 or SQL3), 2003 (SQL:2003), 2006 (SQL:2006), 2011 (SQL:2011) and 2016 (SQL:2016). However, most of the database vendors have their own directs, e.g., PL/SQL (Oracle), Transact-SQL (Microsoft, SAP), PL/pgSQL (PostgreSQL).
A relational database system organizes data in the following hierarchy:
Suppose we have a database called studentdb
, a table called class101
in the database with 3 columns (id
, name
, gpa
) and 4 rows as illustrated below. Each column has a data type. We choose: INT
(integer) for column id
, VARCHAR(50)
(variable-length string of up to 50 characters) for name
, and FLOAT
(floating-point number) for gpa
.
SQL (Structure Query Language) defines a set of intuitive commands (such as SELECT
, INSERT
, DELETE
, UPDATE
) to interact with relational database system.
SQL is a programming language for interacting with relational databases. On the other hand, MySQL is a software - a Relational Database Management System.
MySQL is one of the most used, industrial-strength, open-source and free Relational Database Management System (RDBMS). MySQL was developed by Michael 'Monty' Widenius and David Axmark in 1995. It was owned by a Swedish company called MySQL AB, which was bought over by Sun Microsystems in 2008. Sun Microsystems was acquired by Oracle in 2010.
MySQL is successful, not only because it is free and open-source (there are many free and open-source databases, such as PostgreSQL, Apache Derby (Java DB), mSQL (mini SQL), SQLite and Apache OpenOffice's Base), but also for its speed, ease of use, reliability, performance, connectivity (full networking support), portability (run on most OSes, such as Unix, Windows, macOS), security (SSL support), small size, and rich features. MySQL supports all features expected in a high-performance relational database, such as transactions, foreign key, replication, subqueries, stored procedures, views and triggers.
MySQL is often deployed in a LAMP (Linux-Apache-MySQL-PHP), WAMP (Windows-Apache-MySQL-PHP), or MAMP (macOS-Apache-MySQL-PHP) environment. All components in LAMP is free and open-source, inclusive of the Operating System.
The mother site for MySQL is https://www.mysql.com. The ultimate reference for MySQL is the 'MySQL Reference Manual', available at https://dev.mysql.com/doc. The reference manual is huge - the PDF has over 3700 pages!!!
MySQL operates as a client-server system over TCP/IP network. The server runs on a machine with an IP address on a chosen TCP port number. The default TCP port number for MySQL is 3306. Users can access the server via a client program, connecting to the server at the given IP address and TCP port number.
Extracted from Wiki: MariaDB is a community-developed, commercially supported fork of the MySQL relational database management system (RDBMS), intended to remain free and open-source software under the GNU General Public License. Development is led by some of the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle Corporation in 2009.
I want you to install MySQL on your own machine, because I want you to learn how to install, customize and operate complex industrial software system. Installation could be the hardest part in this exercise.
IMPORTANT: Before getting started, check that you have a few GBs of Free Spaces.
Create a directory to keep all your works called:
c:myWebProject
'.~/myWebProject
' where '~
' denotes your home directory.Use your graphical interface, e.g., File Explorer (Windows), or Finder (macOS) to verify this directory. (Of course you can use your graphical interface to create this directory!)
For novices: It is important to follow this step. Otherwise, you will be out-of-sync with this article and will not be able to find your files later.
For Windows
mysql-8.0.{xx}-winx64.zip
)'.C:myWebProject
'. MySQL will be unzipped as 'c:myWebProjectmysql-8.0.{xx}-winx64
'. (Right click on the file ⇒ Extract All ⇒ Choose the destination folder as 'c:myWebProject
'.)c:myWebProjectmysql
'. Take note and remember your MySQL installed directory!!!root
is created with a temporary password, as shown above. TAKE NOTE of the PASSWORD, COPY and SAVE it somewhere, and also TAKE A PICTURE!!!C:myWebProjectmysql
', and REPEAT step 2 and 3.For macOS
Notes: The latest version of MySQL (8.0.23) works with macOS Catalina (10.15) and Big Slur (11). If you are running older version of macOS, you may need to find an archived version of MySQL @ https://dev.mysql.com/downloads/ ⇒ Archive.
mysql-8.0.{xx}-macos10.15-x86_64.dmg
). .dmg
' file downloaded.mysql-8.0.{xx}-osx-10.{xx}-x86_64.pkg
'./usr/local/
mysql
'. Take note of this installed directory!!dmg
' file./usr/local
(via Finder ⇒ Go ⇒ GoTo Folder ⇒ type /usr/local
) and remove all the folders beginning with 'mysql...
', e.g., 'mysql-8.0.{xx}...
' and 'mysql
', and Re-run Step 2.For Ubuntu
Refer to 'How to install MySQL on Ubuntu'.
I shall assume that MySQL is installed in directory 'c:myWebProjectmysql
' (for Windows) or '/usr/local/mysql
' (for macOS). But you need to TAKE NOTE OF YOUR MySQL INSTALLED DIRECTORY. Hereafter, I shall denote the MySQL installed directory as <MYSQL_HOME>
in this article.
The MySQL is a client-server system. The database is run as a server application. Users access the database server via a client program, locally or remotely thru the network, as illustrated:
mysqld
' (with a suffix 'd'
, which stands for daemon - a daemon is a non-interactive process running in the background).mysql
' (without the 'd'
).The programs mysqld
and mysql
are kept in the 'bin
' sub-directory of the MySQL installed directory.
For Windows
To start the database server, launch a new CMD shell:
Note: The --console
option directs the output messages to the console. Without this option, you will see a blank screen.
For macOS
The EASY WAY: Via graphical control. Click 'Apple' Icon ⇒ System Preferences ⇒ MySQL ⇒ Start or Stop.
The MySQL database server is now started, and ready to handle clients' requests.
Anything that can possibly go wrong, does! Read 'How to Debug'.
For Windows
The quickest way to shut down the database server is to press Ctrl-C to initiate a normal shutdown. DO NOT KILL the server via the window's CLOSE button.
Observe these messages from the MySQL server console:
For macOS
The EASY WAY: Via the graphical control. Click 'Apple' Icon ⇒ System Preferences ⇒ MySQL ⇒ Stop.
WARNING: You should properly shutdown the MySQL server. Otherwise, you might corrupt the database and might have problems restarting it. BUT, if you encounter problem shutting down the server normally, you may kill the 'mysqld
' process in Task Manager (for Windows); or Activity Monitor (for macOS); or System Monitor (for Ubuntu).
Recall that the MySQL is a client-server system. Once the server is started, one or more clients can be connected to the database server. A client could be run on the same machine (local client); or from another machine over the network (remote client).
To login to the MySQL server, you need to provide a username and password. During the installation, MySQL creates a superuser called 'root
' with a temporary password. I hope that you have taken note of this password! (Otherwise, re-install!)
The MySQL installation provides a command-line client program called 'mysql
'. (Recall that the server program is called 'mysqld
' with a suffix 'd'
; the client program does not have the suffix 'd
').
Let's start a command-line client with the superuser 'root
'.
First, make sure that the server is running. See previous step to re-start the server if it has been shutdown.
For Windows
Start Another NEW CMD shell to run the client (You need to keep the CMD that run the server):
For macOS
Open a NEW 'Terminal' and issue these commands to start a MySQL client with superuser root
:
(Skip Unless...) Read 'How to Debug'.
As mentioned earlier, the MySQL installation creates a superuser called 'root
' with a temporary random password. 'root
' is a privileged user that can do anything, including deleting all the databases. You are required to change the root's password immediately after logging in.
Notes: If you get stuck entering a command, press Ctrl-C to abort the current command.
Let's continue with our client session started earlier.
We have just changed the password for root
and exited the client. Start a client and login as root
again. Enter the password when prompted.
For macOS
The superuser 'root' is privileged, which is meant for database administration and is not meant for operational. We shall create a new user - let's call it 'myuser
' - with a lesser privilege. To create a new user, start a client with superuser 'root
':
create user
' to create a new user called 'myuser'@'localhost'
, who can login to the server locally from the same machine (but not remotely from another machine), with password 'xxxx
'.select
. We use the 'grant
' command to grant 'all
' the privileges (including select
, insert
, delete
, and so on) to this new user on ALL the databases and ALL the tables ('on *.*
'). This new user, in practice, has the same privilege as root
, except that it cannot issue grant
command. For production, you should grant only the necessary privileges on selected databases and selected tables, e.g., 'grant select
, insert
, update on studentdb.*
' - it can issue select
, insert
and update
(but no delete
, create/drop table
) on ALL the tables of the database studentdb
only.Recall that the MySQL server organizes data in the following hierarchy:
Let's create a database called 'studentdb
', and a table called 'class101
' in the database. The table shall have three columns: id
(of the type INT
- integer), name
(of the type VARCHAR(50)
- variable-length string of up to 50 characters), gpa
(of the type FLOAT
- floating-point number).
CAUTION: Programmers don't use blank and special characters in NAMES (database names, table names, column names). It is either not supported, or will pose you many more challenges.
Before we proceed, here are some tips on using the client:
;
), which sends the command to the server for processing. E.g., ->
to denote continuation. You need to terminate the command with a semicolon (;
). E.g., In other words, if you forget to type ';'
, you can type the ';'
on the next line.c
to cancel (abort) the current command. E.g., '>
or '>
(instead of ->
). For example, Let's start a client with our newly-created user 'myuser
'.
'K'
. (Hints: name like 'K%'
, see Section 'SQL by Examples')'K'
. (Hints: name NOT like ...
)gpa
between 4.35 and 4.65. (Hints: test-1 AND test-2
)'e'
. (Hints: name like '%e%'
)'e'
or 'a'
. (Hints: test-1 OR test-2
)'e'
and gpa ≥ 4.5
.(Skip Unless... ) Read 'How to Debug'.
ABCTrading
'.ABCTrading
' database as the default database.products
' with the columns and type indicated below. Pencil
'.In a bookstore, a book is written by one or more authors; an author may write zero or more books. This is known as a many-to-many relationship. It is IMPOSSIBLE to capture many-to-many relationship in a SINGLE table (or one spreadsheet) with a fixed number of columns, without duplicating any piece of information! For example, if you organize the data in the table below, you will not know how many author columns to be used; and you need to repeat all the data for repeating authors.
The many-to-many relationship between books and authors can be modeled with 3 tables, as shown below. A books
table contains data about books (such as title and price); an authors
table contains data about the authors (such as name and email). A table called books_authors
joins the books
and authors
tables and captures the many-to-many relationship between books
and authors
.
mybookstore
'.mybookstore
' as the default database.books
', 'authors
', and 'books_authors
' in the database 'mybookstore
', with column names and types as shown in the database diagram.title
, price
, qty
) by 'Tan Ah Teck' with price
less than 20
.name
and email
) for the book title 'Java for Dummies'.title
, price
, qty
) and all the authors (name
and email
) for books with title beginning with 'Java' (Hints: title LIKE 'Java%'
).You can use the 'mysqldump'
utility program to back up (i) the entire server (all databases), (ii) selected databases, or (ii) selected tables of a database. The 'mysqldump
' program generates a SQL script that can later be executed to re-create the databases, tables and their rows.
For example, the following command backups the entire 'studentdb
' database to a SQL script called 'backup_studentdb.sql
'.
For macOS
Study the output file, which contains CREATE DATABASE
, CREATE TABLE
and INSERT
statements to re-create the database and tables dumped earlier.
You can restore from the backup by running the 'source
' command in a MySQL client. For example, to restore the studentdb
backup earlier:
For macOS
MySQL commands are NOT case sensitive.
'Everything that can possibly go wrong will go wrong.' The most important thing to do is to find the ERROR MESSAGES!!!
CAUSE: You do not have the required 'Microsoft Visual C++ redistributable runtime'.
SOLUTION: Goto 'The latest supported Visual C++ downloads' @ https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads ⇒ Download 'x64: vc_redist.x64.exe
' ⇒ run the executable to install 'Microsoft Visual C++ 2015-2019 redistributable (x64)' ⇒ Restart your computer ⇒ You can find 'vcruntime140_1.dll
' under 'C:WindowsSystem32
'.
First of all, check if you have already started an instance of MySQL Server:
mysqld
' processes. 'End' all the 'mysqld
' processes.mysqld
' processes. 'Kill' all the 'mysqld
' processes.mysqld
' processes. 'Kill' all the 'mysqld
' processes.No more disk space?!
Update: oracle has released version 6.3.10! I recently updated my macbook pro to macos high sierra. Like every other os update, this one was fairly uneventful – with the exception of having to do a hard reboot to get the mac to come back up after the upgrade. That was definitely a nail biter! Once the continue reading 'hidden results grid on mysql workbench and macos high sierra'. We can see that the root user can only connect to the embedded MySQL server on localhost, and the localhost is the XAMPP embedded Linux server, but MySQL workbench is running on the Mac OS. So you should grant root user access permission to the MySQL server from any machine with ‘%’ as the host value.
Server: The TCP/IP address or host name of the server running a MySQL server. 127.0.0.1 Port: The TCP/IP port on which the MySQL server is listening. 3306 Database: Name of the current database for the connection. If the Database is not specified, no current database is set up. MyDB UserName: The MySQL user ID. Root Password: The MySQL. MySQL Workbench is a unified visual tool for database architects, developers, and DBAs. MySQL Workbench provides data modeling, SQL development, and comprehensive administration tools for server configuration, user administration, backup, and much more. MySQL Workbench is available on Windows, Linux and Mac OS X.
In this tutorial we will learn to install Apache, MySQL, PHP on macOS Catalina 10.15. About macOS Catalina. Apple released macOS Catalina 10.15 on 7th October 2019 and it includes Apache and PHP. So, all we have to do is enable them. Then install MySQL and we are ready for development. So, lets get started. Tagged MacOS macos-carbon macos-catalina macos-high-sierra macos-mojave macos-sierra mysql mysql-error-1045 mysql-workbench mysqli workbench Post navigation Binding an element of an array of an ObservableObject: ‘subscript(:)’ is deprecated. Hello Friends,In this video tutorial, you will learn to install MySql workbench 8.0 on mac os x Catalina. I have explained the whole process of installation.
(mysql-8.0.22-winx64.zip) MD5: a78e5da2bb87b51b6df06690977be199 Signature Windows (x86, 64-bit), ZIP Archive Debug Binaries & Test Suite: Sep 23, 2020: 434.4M. MySQL Community Edition is a freely downloadable version of the world's most popular open source database that is supported by an active community of open source developers and enthusiasts. MySQL Cluster Community Edition is available as a separate download.
MySQL Community Edition is a freely downloadable version of the world's most popular open source database that is supported by an active community of open source developers and enthusiasts.
MySQL Cluster Community Edition is available as a separate download. The reason for this change is so that MySQL Cluster can provide more frequent updates and support using the latest sources of MySQL Cluster Carrier Grade Edition.
MySQL 8.0 is the most current GA release. Download MySQL 8.0 »
Learn What's New in MySQL 8.0 and view the Performance Benchmarks.
Online Documentation:
| Looking for previous GA versions? |
Please report any bugs or inconsistencies you observe to our Bugs Database.
Thank you for your support!