Programming/MySQL: Difference between revisions

From Dev Wiki
Jump to navigation Jump to search
(Create page)
 
(Correct link)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
[https://www.mysql.com/ MySQL] is an open source database management system.


== Installation ==
It is one of the most commonly used database systems, designed to work with the SQL standard.


=== Ubuntu ===
Alternatives are [[Programming/MariaDB | MariaDB]] and [[Programming/PostgreSQL | PostgreSQL]].
Basic installation can be performed with:
{{ bc | sudo apt install mysql-server }}


From here, you can access MySQL via:
== Setup ==
{{ bc | sudo mysql }}
* [[Programming/MySQL/Setup | Setup]]


==== Securing the Installation ====
== Syntax ==
Note that the above command alone is an insecure installation, and is not suitable for things like production, or instances where stored data is not just test data and thus should be stored securely.
* [[Programming/MySQL/Databases | Databases]]
* [[MySQL/Queries | Queries]]


To configure MySQL for security also run:
 
{{ bc | sudo mysql_secure_installation }}
== Basics ==
=== Accessing the MySQL Shell ===
You can access the MySQL server from a terminal via the MySQL shell.
 
If you have a fresh install with no setup yet, then this is likely done via:
sudo mysql
 
If you have done some setup, such as setting a password for the root account or creating a user to login with, then use:
mysql -u <username> -p
 
=== Exiting the MySQL Shell ===
exit
 
or
\q

Latest revision as of 06:58, 20 November 2020

MySQL is an open source database management system.

It is one of the most commonly used database systems, designed to work with the SQL standard.

Alternatives are MariaDB and PostgreSQL.

Setup

Syntax


Basics

Accessing the MySQL Shell

You can access the MySQL server from a terminal via the MySQL shell.

If you have a fresh install with no setup yet, then this is likely done via:

sudo mysql

If you have done some setup, such as setting a password for the root account or creating a user to login with, then use:

mysql -u <username> -p

Exiting the MySQL Shell

exit

or

\q