MySQL: Difference between revisions
Jump to navigation
Jump to search
Line 55: | Line 55: | ||
|valign="top"| | |valign="top"| | ||
|} | |||
==Playground== | |||
{| | |||
| valign="top" | | |||
<syntaxhighlight lang="sql"> | |||
SELECT @@character_set_database, @@collation_database; | |||
</syntaxhighlight> | |||
| valign="top" | | |||
| valign="top" | | |||
|- | |||
| colspan="3" | | |||
---- | |||
|- | |||
| valign="top" | | |||
| valign="top" | | |||
| valign="top" | | |||
|} | |} |
Revision as of 01:45, 25 October 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
|
Playground
SELECT @@character_set_database, @@collation_database;
|
||
| ||
References
| ||