MySQL Community Edition (CE) Cheat-Sheet
MySQL Community Edition is the freely downloadable version of the world's most popular open source database.
Project Homepage: MySQL Community Edition Documentation: MySQL Docs
Editor's note: The MariaDB Project was forked from MySQL when Sun Microsystems' intellectual property was acquired by Oracle. MariaDB still shares enormous inter-compatibility with MySQL functions and software interoperability, and performance at most scales is arguably indiscernible from MySQL CE. In this writers' opinion it is not beneficial in most cases to favor Oracle's monetized option over the GPL's MariaDB alternative.
Installation
Install MySQL on Debian/Ubuntu/Mint/Zorin/Deb forks
[!warning] Common Debian repositories don't populate MySQL CE and require a vendor-provided repository available here. The repo file in this example is current as of 2024-01-20.
1 2 3 4 5 6 7 8 | |
Install MySQL on RHEL/Fedora/CentOS/Alma/Rocky
1 2 3 | |
Install MySQL on Arch/Manjaro/Arco/ Arch forks
[!warning] Common Arch repositories don't populate MySQL CE and the vendor doesn't provide one. The packages are available in the AUR but this is *not recommended* for a production environment!!
Enable the AUR (if not already available)
[!notice] This must be done by a non-root user!
1 2 3git clone https://aur.archlinux.org/yay.git cd yay makepkg -si
Proceed with installation from the AUR
1 2 3 | |
Deploy MySQL in Docker
- https://hub.docker.com/_/mysql/
- https://dev.mysql.com/doc/mysql-installation-excerpt/8.0/en/docker-mysql-getting-started.html
Deploy MySQL in Kubernetes
- https://dev.mysql.com/doc/mysql-operator/en/
- https://kubernetes.io/docs/tasks/run-application/run-single-instance-stateful-application/
Create Administrative User
Access the MySQL command line by entering mysql -u root -p in the shell followed by the Database root password.
Create a new user newuser for the host localhost with a new password:
1 | |
Grant all permissions to the new user
1 | |
Update permissions
1 | |