MySQL: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
{|
|valign="top"|
<syntaxhighlight lang="bash">
sudo apt-get install mariadb-server mariadb-client
sudo systemctl enable --now mariadb
systemctl status mariadb
mariadb --version
</syntaxhighlight>
|valign="top"|
<syntaxhighlight lang="bash">
sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf
sudo systemctl restart mariadb.service
systemctl status mariadb.service
sudo mysql_secure_installation
</syntaxhighlight>
|}
==Authorization==
{|
{|
|valign="top"|
|valign="top"|
Line 7: Line 27:
CREATE USER 'chorke'@'localhost' IDENTIFIED VIA unix_socket;
CREATE USER 'chorke'@'localhost' IDENTIFIED VIA unix_socket;
GRANT ALL PRIVILEGES ON *.* TO 'chorke'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'chorke'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
DDL
DDL
</syntaxhighlight>
</syntaxhighlight>
Line 17: Line 38:
CREATE USER 'chorke_orgwiki'@'localhost' IDENTIFIED BY 'sadaqah!';
CREATE USER 'chorke_orgwiki'@'localhost' IDENTIFIED BY 'sadaqah!';
GRANT ALL PRIVILEGES ON chorke_orgwiki.* TO 'chorke_orgwiki'@'localhost';
GRANT ALL PRIVILEGES ON chorke_orgwiki.* TO 'chorke_orgwiki'@'localhost';
FLUSH PRIVILEGES;
DDL
DDL
</syntaxhighlight>
</syntaxhighlight>
Line 28: Line 50:
CREATE USER 'chorke_orgwiki'@'%' IDENTIFIED BY 'sadaqah!';
CREATE USER 'chorke_orgwiki'@'%' IDENTIFIED BY 'sadaqah!';
GRANT ALL PRIVILEGES ON chorke_orgwiki.* TO 'chorke_orgwiki'@'%';
GRANT ALL PRIVILEGES ON chorke_orgwiki.* TO 'chorke_orgwiki'@'%';
FLUSH PRIVILEGES;
DDL
DDL
</syntaxhighlight>
</syntaxhighlight>
Line 38: Line 61:
{|
{|
|valign="top"|
|valign="top"|
* [https://www.hostinger.my/tutorials/how-to-install-and-setup-phpmyadmin-on-ubuntu MySQL » Ubuntu » phpMyAdmin » Install]
* [https://dev.mysql.com/blog-archive/accessing-the-same-data-through-ldap-and-sql/ MySQL » LDAP Store & Fetch Data]
* [https://dev.mysql.com/blog-archive/accessing-the-same-data-through-ldap-and-sql/ MySQL » LDAP Store & Fetch Data]
* [https://docs.vultr.com/how-to-install-mariadb-on-ubuntu-24-04 MySQL » Ubuntu » 24.04 » Install]
* [[MySQL/Dump|MySQL » Dump]]
* [[MySQL/Dump|MySQL » Dump]]
* [[Helm/MariaDB|MySQL » Helm]]


|valign="top"|
|valign="top"|
Line 50: Line 76:
|-
|-
|valign="top"|
|valign="top"|
* [[K8s/Ingress]]
* [[PostgreSQL]]
* [[PostgreSQL]]
* [[OpenLDAP]]
* [[OpenLDAP]]
* [[HAProxy]]
* [[Helm]]
* [[CIDR]]
* [[UFW]]


|valign="top"|
|valign="top"|

Latest revision as of 03:54, 26 September 2024

sudo apt-get install mariadb-server mariadb-client
sudo systemctl enable --now mariadb
systemctl status mariadb
mariadb --version
sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf
sudo systemctl restart mariadb.service
systemctl status mariadb.service
sudo mysql_secure_installation

Authorization

MySQL » Auth » Unix

sudo su
cat << DDL | mysql
CREATE USER 'chorke'@'localhost' IDENTIFIED VIA unix_socket;
GRANT ALL PRIVILEGES ON *.* TO 'chorke'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
DDL

MySQL » Auth » Local

cat << DDL | mysql
CREATE DATABASE IF NOT EXISTS chorke_orgwiki;
CREATE USER 'chorke_orgwiki'@'localhost' IDENTIFIED BY 'sadaqah!';
GRANT ALL PRIVILEGES ON chorke_orgwiki.* TO 'chorke_orgwiki'@'localhost';
FLUSH PRIVILEGES;
DDL

MySQL » Auth » Remote

cat << DDL | mysql
CREATE DATABASE IF NOT EXISTS chorke_orgwiki;
CREATE USER 'chorke_orgwiki'@'%' IDENTIFIED BY 'sadaqah!';
GRANT ALL PRIVILEGES ON chorke_orgwiki.* TO 'chorke_orgwiki'@'%';
FLUSH PRIVILEGES;
DDL

References