MySQL: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
(Created page with "{| |valign="top"| '''MySQL » Auth » Unix''' <syntaxhighlight lang="sql"> cat << DDL | mysql -- CREATE DATABASE IF NOT EXISTS shahed; CREATE USER 'chorke'@'localhost' IDENTIFIED VIA unix_socket; GRANT ALL PRIVILEGES ON *.* TO 'chorke'@'localhost' WITH GRANT OPTION; DDL </syntaxhighlight> |valign="top"| '''MySQL » Auth » Local''' <syntaxhighlight lang="sql"> cat << DDL | mysql CREATE DATABASE IF NOT EXISTS chorke_orgwiki; CREATE USER 'chorke_orgwiki'@'localhost' IDENT...")
 
No edit summary
Line 3: Line 3:
'''MySQL » Auth » Unix'''
'''MySQL » Auth » Unix'''
<syntaxhighlight lang="sql">
<syntaxhighlight lang="sql">
sudo su
cat << DDL | mysql
cat << DDL | mysql
-- CREATE DATABASE IF NOT EXISTS shahed;
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;

Revision as of 21:14, 31 March 2024

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;
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';
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'@'%';
DDL