pi@raspberrypi:~ $ sudo apt-get install mariadb-server

 

pi@raspberrypi:~ $ mysql -V
mysql  Ver 15.1 Distrib 10.3.22-MariaDB, for debian-linux-gnueabihf (armv8l) using readline 5.2

 

pi@raspberrypi:~ $ sudo mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 53
Server version: 10.3.22-MariaDB-0+deb10u1 Raspbian 10

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

 

<계정생성>

UPDATE mysql.user SET password=password('패스워드') WHERE user='root';
FLUSH PRIVILEGES;

create database tensorflow;

drop user '계정';
create user '계정'@'%' identified by '패스워드!';
create user '계정'@'localhost' identified by '패스워드!';

grant all privileges on DB명.* to '계정'@'localhost';
grant all privileges on DB명.* to '계정'@'%';

flush PRIVILEGES;

 

 

<방화벽 설정>

 

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf 
50-server.cnf 파일에서 bind-address = 127.0.0.1부분을 주석처리

 

# sudo iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
# sudo iptables -A OUTPUT -p tcp --dport 3306 -j ACCEPT
# sudo iptables-save

pi@raspberrypi:~ $ service mysql stop
pi@raspberrypi:~ $ service mysql start


 

'Raspberry Pi' 카테고리의 다른 글

JDK Install  (0) 2020.01.18
Python Install  (0) 2020.01.18
Network Drive Mount(WD Cloud)  (0) 2020.01.18
Raspberry Pi 설치  (0) 2019.05.07

+ Recent posts