Serveur Debian

Administration con centré . com !

Serveur Debian

Installer MariaDB

sudo apt install mariadb-server -y
sudo mysql_secure_installation


Configuration de MariaDB

Modifiez le fichier de configuration de MariaDB (my.cnf ou mariadb.cnf). Sur la plupart des systèmes, ce fichier se trouve dans /etc/mysql/ ou /etc/mariadb/.

cd /etc/mysql/                         
cd /etc/mariadb/                
sudo nano /etc/mysql/mariadb.cnf

c'est valeur sont accessible sur phpmyadmin dans Accueil / Variables et paramètres du serveur

[mysqld]
#port = 3306
#bind-address = 127.0.0.1
#datadir = /var/lib/mysql
#socket = /var/run/mysqld/mysqld.sock
#log_error = /var/log/mysql/error.log
#pid-file = /var/run/mysqld/mysqld.pid
#
#max_connections = 100
#query_cache_size = 16M
#query_cache_type = 1
#innodb_buffer_pool_size = 256M
#innodb_log_file_size = 64M
#innodb_flush_log_at_trx_commit = 1
#
#skip-networking      #Désactive les connexions réseau, permettant uniquement les connexions locales via le socket Unix.          
#skip-name-resolve    #Désactive la résolution de nom d'hôte pour améliorer les performances.
#
#log_bin = /var/log/mysql/mysql-bin.log
#server_id = 1        #L'identifiant unique du serveur pour la réplication.
#binlog_format = MIXED  #(ROW, STATEMENT, MIXED)
#relay_log = /var/log/mysql/mysql-relay-bin.log
#
#default_storage_engine = InnoDB
#character_set_server = utf8mb4
#collation_server = utf8mb4_general_ci


sudo systemctl restart mariadb systemctl status mariadb sudo systemctl stop mariadb sudo apt-get remove --purge mariadb-server mariadb-client mariadb-common sudo apt-get autoremove sudo apt-get autoclean sudo rm -rf /etc/mysql /var/lib/mysql sudo deluser mysql sudo delgroup mysql

Phpmyadmin

http://votre_ip/phpmyadmin

sudo apt install phpmyadmin -y

# sudo apt install pwgen 


sudo nano /etc/phpmyadmin/config.inc.php

$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'phpmyadmin';
$cfg['Servers'][$i]['password'] = 'your_password';

$cfg['UploadDir'] = '';
$cfg['MaxFileSize'] = 16777216; // 16 MB en octets
$cfg['ExecTimeLimit'] = 300; // 5 minutes

sudo mariadb
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
SHOW GRANTS FOR 'phpmyadmin'@'localhost';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' IDENTIFIED BY PASSWORD 'your_password' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
CREATE USER 'doc_user'@'localhost' IDENTIFIED BY 'doc_password';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'doc_user'@'localhost';
FLUSH PRIVILEGES;
sudo systemctl restart mariadb;
sudo systemctl restart apache2;
sudo mariadb -u phpmyadmin -p;
CREATE DATABASE testdb;

sudo apt-get remove --purge phpmyadmin
sudo apt-get autoremove
sudo rm -rf /etc/phpmyadmin
sudo systemctl restart apache2

sudo apt-get remove --purge phpmyadmin sudo apt-get autoremove sudo apt-get autoclean sudo rm -rf /usr/share/phpmyadmin /var/lib/phpmyadmin /etc/phpmyadmin