xammp avanzato e mysql - polito.itlioy/01nbe/xampp_mysql.pdf+rvwyluwxdol ²frqiljxud]lrql srvvlelol...
TRANSCRIPT
![Page 1: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/1.jpg)
Configurazione avanzata di XAMPP
Andrea Atzeni ([email protected])
Marco Vallini ([email protected])
Politecnico di Torino
Dip. Automatica e Informatica
![Page 2: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/2.jpg)
Apache – Binding
definisce su quali indirizzi IP e porte il server risponde
default: tutti gli indirizzi IP (v4 e v6) del server, porta 80
l’indirizzo IP può essere omesso
il server risponde per tutti gli IP configurati
porta sempre specificata
esempi:
indirizzo 192.168.0.1, porta 80
per tutti gli indirizzi IP del server (0.0.0.0)
sulle porte 80 e 8080 (e per tutti gli indirizzi IP del server)
definito all’interno del file di configurazione di Apache
“C:\xampp\apache\conf\httpd.conf” (in MS Windows)
attraverso la direttiva “Listen”
![Page 3: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/3.jpg)
Apache – Binding, esempio
Listen 80Listen 8080
Listen 80Listen 192.168.0.1:8080
Listen [::]:80Listen 127.0.0.1:80
interfaccia loopback IPv6, porta 80
indirizzo locale IPv4, porta 80
![Page 4: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/4.jpg)
Apache – Binding, esempio
Listen 80Listen 8080
Listen 80Listen 192.168.0.1:8080
Listen [::]:80Listen 127.0.0.1:80
tutti gli indirizzi IPv4 e IPv6, porte 80 e 8080
![Page 5: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/5.jpg)
Apache – Binding, esempio
Listen 80Listen 8080
Listen 80Listen 192.168.0.1:8080
Listen [::]:80Listen 127.0.0.1:80
tutti gli indirizzi IPv4e IPv6, porta 80
all’indirizzo 192.168.0.1 il serverrisponde anche sulla porta 8080
![Page 6: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/6.jpg)
Host virtuali
problema: ospitare più servizi sullo stesso server
gli indirizzi IPv4 pubblici sono pochi, sempre meno!
tipicamente venduti a blocchi: 1, 8, 16, …
non sempre possibile definire una coppia indirizzo IP/porta per tutti i servizi
caso più diffuso: domini web
un hosting provider può ospitare migliaia di domini
non è possibile acquistare un indirizzo IP per ogni dominio
necessario adottare host virtuali
![Page 7: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/7.jpg)
Host virtuali – configurazioni possibili
IP-based
una coppia indirizzo IP/porta per ogni host virtuale
utile solo per pochi siti web
non applicabile per provider che ospitano migliaia di siti web
name-based
identificato con un nome
es. www.ilmiosito.it
utile se si hanno pochi indirizzi IP pubblici
es. per gestire migliaia di siti web sullo stesso host fisico
richiede anche la configurazione del DNS
creando vari alias (record CNAME) che puntano tutti allo stesso indirizzo IP
HTTP indica il server giusto col request header "Host:"
![Page 8: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/8.jpg)
Host virtuali – Apache
Virtualhost: meccanismo per configurare più siti web sullo stesso server
insieme di direttive per la configurazione di Apache
ServerName (es. www.ilmiosito.it)
DocumentRoot (es. “C:\xampp\htdocs\ilmiosito.it\” in Win)
XAMPP: nessuna configurazione predefinita
file di configurazione“C:\xampp\apache\conf\extra\httpd-vhosts.conf” (in Win)
![Page 9: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/9.jpg)
Apache – esempio del funzionamento
server DNS
server web(IP: 1.2.3.4)
1. www.ilmiosito.it ?
ServerName: www.ilmiosito.itDocumentRoot: "..\ilmiosito.it"
2. 1.2.3.4
![Page 10: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/10.jpg)
Apache – esempio del funzionamento
server DNS
server web(IP: 1.2.3.4)
1. www.ilmiosito.it ?
ServerName: www.ilmiosito.itDocumentRoot: "..\ilmiosito.it"
2. 1.2.3.4
HTTP Request Header:GET / HTTP/1.1Host: www.ilmiosito.it
![Page 11: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/11.jpg)
Apache – esempio del funzionamento
server DNS
server web(IP: 1.2.3.4)
1. www.ilmiosito.it ?
ServerName: www.ilmiosito.itDocumentRoot: "..\ilmiosito.it"
2. 1.2.3.4
![Page 12: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/12.jpg)
Apache – esempio name-based
"
<VirtualHost *:80>
ServerAdmin [email protected] www.ilmiosito.it
# Document RootDocumentRoot "C:\xampp\htdocs\ilmiosito.it\"
# LogfilesErrorLog "C:\xampp\apache\logs\ilmiosito.it\error.log"
</VirtualHost>
tutti gli IP del server sulla porta 80
![Page 13: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/13.jpg)
Apache – esempio name-based
<VirtualHost *:80>
ServerAdmin [email protected] www.ilmiosito.it
# Document RootDocumentRoot "C:\xampp\htdocs\ilmiosito.it\"
# LogfilesErrorLog "C:\xampp\apache\logs\ilmiosito.it\error.log"
</VirtualHost>
indirizzo e-mail dell’amministratoredel sito web
![Page 14: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/14.jpg)
Apache – esempio name-based
<VirtualHost *:80>
ServerAdmin [email protected] www.ilmiosito.it
# Document RootDocumentRoot "C:\xampp\htdocs\ilmiosito.it\"
# LogfilesErrorLog "C:\xampp\apache\logs\ilmiosito.it\error.log"
</VirtualHost>
nome del sito web
![Page 15: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/15.jpg)
Apache – esempio name-based
<VirtualHost *:80>
ServerAdmin [email protected] www.ilmiosito.it
# Document RootDocumentRoot "C:\xampp\htdocs\ilmiosito.it\"
# LogfilesErrorLog "C:\xampp\apache\logs\ilmiosito.it\error.log"
</VirtualHost>cartella per le pagine web del sito
![Page 16: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/16.jpg)
Apache – esempio name-based
<VirtualHost *:80>
ServerAdmin [email protected] www.ilmiosito.it
# Document RootDocumentRoot "C:\xampp\htdocs\ilmiosito.it\"
# LogfilesErrorLog "C:\xampp\apache\logs\ilmiosito.it\error.log"
</VirtualHost>
file di log per eventuali errori
![Page 17: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/17.jpg)
Apache – esempio IP-based
"
<VirtualHost 192.168.0.1:80>
# Document RootDocumentRoot "C:\xampp\htdocs\ilmiosito.it\"
# LogfilesErrorLog "C:\xampp\apache\logs\ilmiosito.it\error.log"
</VirtualHost>
si applica per l’indirizzo 192.168.0.1 sulla porta 80
![Page 18: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/18.jpg)
Apache – esempio IP-based
<VirtualHost 192.168.0.1:80>
# Document RootDocumentRoot "C:\xampp\htdocs\ilmiosito.it\"
# LogfilesErrorLog "C:\xampp\apache\logs\ilmiosito.it\error.log"
</VirtualHost>cartella per le pagine web del sito
![Page 19: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/19.jpg)
Apache – esempio IP-based
<VirtualHost 192.168.0.1:80>
# Document RootDocumentRoot "C:\xampp\htdocs\ilmiosito.it\"
# LogfilesErrorLog "C:\xampp\apache\logs\ilmiosito.it\error.log"
</VirtualHost>
file di log per eventuali errori
![Page 20: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/20.jpg)
MySQL/MariaDB
gestore di basi di dati relazionale (RDBMS)
relazionale: basato su relazioni = tabelle
versioni open source (MariaDB) e commerciali (MySQL)
disponibile per molti sistemi operativi
molto diffuso
integrato e pre-configurato in XAMPP
avvio/stop servizio, configurazione porte da pannello di controllo
interfaccia di gestione in PHP (phpMyAdmin)
file di configurazione “C:\xampp\mysql\bin\my.ini”(in MS Windows)
![Page 21: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/21.jpg)
Avvio di MySQL/MariaDB
ATTENZIONE: verificare che non siano attive altre istanze di MySQL/MariaDB prima di procedere
aprire la lista dei processi di sistema
dal menù Start digitare “Services” o “Servizi”
verificare se tra i servizi è attivo quello di MySQL/MariaDB
nel caso fosse attivo, fermarlo e disabilitare l’avvio automatico
![Page 22: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/22.jpg)
Avvio di MySQL/MariaDB
avvio di MySQL
![Page 23: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/23.jpg)
Avvio di MySQL/MariaDB
identificativo del processo
![Page 24: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/24.jpg)
Avvio di MySQL/MariaDB
MySQL avviato (porta 3306)
![Page 25: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/25.jpg)
Stop di MySQL/MariaDB
stop di MySQL
![Page 26: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/26.jpg)
MySQL/MariaDB – accesso al file di configurazione
![Page 27: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/27.jpg)
MySQL/MariaDB – estratto my.ini
...# The MySQL server[mysqld]port = 3306...basedir = "C:/xampp/mysql" tmpdir = "C:/xampp/tmp"datadir = "C:/xampp/mysql/data"pid_file = "mysql.pid"...log_error = "mysql_error.log"...
porta di ascolto del servizio
![Page 28: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/28.jpg)
MySQL/MariaDB – estratto my.ini
...# The MySQL server[mysqld]port = 3306...basedir = "C:/xampp/mysql" tmpdir = "C:/xampp/tmp" datadir = "C:/xampp/mysql/data"pid_file = "mysql.pid"...log_error = "mysql_error.log"...
cartella di installazione di MySQL
![Page 29: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/29.jpg)
MySQL/MariaDB – estratto my.ini
...# The MySQL server[mysqld]port = 3306...basedir = "C:/xampp/mysql" tmpdir = "C:/xampp/tmp"datadir = "C:/xampp/mysql/data"pid_file = "mysql.pid"...log_error = "mysql_error.log"...
cartella per i file temporanei
![Page 30: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/30.jpg)
MySQL/MariaDB – estratto my.ini
...# The MySQL server[mysqld]port = 3306...basedir = "C:/xampp/mysql" tmpdir = "C:/xampp/tmp" datadir = "C:/xampp/mysql/data"pid_file = "mysql.pid"...log_error = "mysql_error.log"...
cartella per memorizzare i dati
![Page 31: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/31.jpg)
MySQL/MariaDB – estratto my.ini
...# The MySQL server[mysqld]port = 3306...basedir = "C:/xampp/mysql" tmpdir = "C:/xampp/tmp" datadir = "C:/xampp/mysql/data"pid_file = "mysql.pid"...log_error = "mysql_error.log"...
contiene l’identificativo del processo
![Page 32: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/32.jpg)
MySQL/MariaDB – estratto my.ini
...# The MySQL server[mysqld]port = 3306...basedir = "C:/xampp/mysql" tmpdir = "C:/xampp/tmp" datadir = "C:/xampp/mysql/data"pid_file = "mysql.pid"...log_error = "mysql_error.log"...
log degli errori
![Page 33: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/33.jpg)
MySQL/MariaDB – estratto my.ini
...# Change here for bind listening# bind-address = "127.0.0.1" # bind-address = :: # for ipv6# bind-address = "192.168.0.1"...
se nulla è specificato, il servizio risponde per tutti gli indirizzi IP del server
![Page 34: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/34.jpg)
MySQL/MariaDB – estratto my.ini
...# Change here for bind listening
bind-address = "127.0.0.1" # bind-address = :: # for ipv6# bind-address = "192.168.0.1"...
servizio disponibile solo perl’indirizzo IPv4 locale
![Page 35: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/35.jpg)
MySQL/MariaDB – estratto my.ini
...# Change here for bind listening# bind-address = "127.0.0.1"
bind-address = :: # for ipv6# bind-address = "192.168.0.1"...
servizio disponibile solosull’interfaccia di loopback IPv6
![Page 36: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/36.jpg)
MySQL/MariaDB – estratto my.ini
...# Change here for bind listening# bind-address = "127.0.0.1" # bind-address = :: # for ipv6
bind-address = "192.168.0.1"...
servizio disponibile solo perl’indirizzo IPv4 192.168.0.1
![Page 37: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/37.jpg)
phpMyAdmin
strumento utile per gestire un server MySQL/MariaDB
interfaccia web semplice
offre funzionalità di base (es. non supporta diagrammi ER)
può essere usato per sistemi di produzione (con cautela)
scritto in PHP, free software
funzionalità principali
creazione di un database
creazione di una nuova tabella
definizione e/o modifica dei campi di una tabella
import/export di un database
interrogazioni mediante query SQL
pre-configurato in XAMPP
raggiungibile da http://localhost/phpmyadmin/
![Page 38: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/38.jpg)
phpMyAdmin – Interfaccia principale
![Page 39: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/39.jpg)
phpMyAdmin – Interfaccia principale
menù principale
lista dei database presenti
![Page 40: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/40.jpg)
phpMyAdmin – Creazione di un database
1. click su “Databases”
2. nome del database (es. miodb)
3. set di caratteri
![Page 41: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/41.jpg)
phpMyAdmin – Creazione di una tabella
1. selezionare il database dove creare la tabella (es. miodb)
2. nome tabella (es. mia_tabella)
3. numero campi (es. 2)
![Page 42: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/42.jpg)
phpMyAdmin – Creazione di una tabella
4. selezionare il database dove creare la tabella (es. miodb)
4. nome dei campi (es. nome, cognome)
5. tipo dei campi (es. varchar)
6. lunghezza dei campi (es. 20) oppure lista di valori per set o enum
![Page 43: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/43.jpg)
phpMyAdmin – Privilegi di accesso
![Page 44: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/44.jpg)
phpMyAdmin – Privilegi di accesso
1. click su “Privileges”
2. selezionare “Add user”
![Page 45: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/45.jpg)
phpMyAdmin – Privilegi di accesso
4. inserire credenziali di accesso
5. scegliere permessigenerali
3. inserire il nome utente
![Page 46: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/46.jpg)
phpMyAdmin – Privilegi di accesso
![Page 47: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/47.jpg)
phpMyAdmin – Privilegi di accesso
6. permettere operazionispecifiche
![Page 48: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/48.jpg)
phpMyAdmin – Query SQL
1. click su SQL
2. Inserimento della query SQL
![Page 49: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/49.jpg)
phpMyAdmin – Export
1. click su Export
2. due modalità:
- veloce (quick), per esportaretutti i database;
- personalizzato (custom), per specificare i database da esportare ed altri parametri
![Page 50: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/50.jpg)
phpMyAdmin – Import
1. click su Import
2. file da importare
![Page 51: XAMMP avanzato e MySQL - polito.itlioy/01nbe/xampp_mysql.pdf+RVWYLUWXDOL ²FRQILJXUD]LRQL SRVVLELOL ,3 EDVHG XQD FRSSLD LQGLUL]]R ,3 SRUWD SHU RJQL KRVWYLUWXDOH XWLOH VROR SHU SRFKL](https://reader030.vdocuments.pub/reader030/viewer/2022041009/5eb509296b8e3833c73901ce/html5/thumbnails/51.jpg)
phpMyAdmin – Import
3. formato (tipicamente SQL)