My linux world » MariaDB

MariaDB


Installation

  1. #!/bin/bash
  2.  
  3. echo "install mariadb-server"
  4. yum -y install mariadb-server phpMyAdmin
  5.  
  6. echo "activate mariadb at startup"
  7. systemctl enable mariadb.service
  8.  
  9. echo "start the server"
  10. systemctl start mariadb.service
  11.  
  12. echo "set password for root. WARN! for this example we choose unsecure password root"
  13. /usr/bin/mysqladmin -u root password 'root'
  14.  
  15. echo "Note: by default only local users can access to phpMyAdmin."
  16. echo "Let's update the file /etc/httpd/conf.d/phpMyAdmin.conf and allow everyone."
  17. sed -i "s/\(Require\s*ip\s*127.0.0.1\)/Require all granted\n\1/i" /etc/httpd/conf.d/phpMyAdmin.conf
  18. sed -i "s/\(Require\s*ip\\)/#\1/i" /etc/httpd/conf.d/phpMyAdmin.conf
  19.  
  20. #Uncomment these following lines to open firewall
  21. #echo "add service to firewalld"
  22. #firewall-cmd --permanent --add-service mysql
  23. #firewall-cmd --reload
  24.  
  25. echo "Now reload httpd"
  26. systemctl reload httpd.service
  27.  

Test

Let’s connect to the database:

mysql -u root -p

Let’s check if the port 3306 is open:

telnet localhost 3306

SOS i am lost!

Have a look at the MariaDB Survival Guide here


Copyright © 2023 My linux world - by Marc RABAHI
Design by Marc RABAHI and encelades.

Fork me on GitHub