Advertisement
Guest User

Untitled

a guest
Sep 28th, 2018
709
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. During the tests for Nextcloud issues, I tried and installed MariaDB + new phpMyAdmin successfully. I am posting the updated instructions here, feel free to check and update your guide .
  2. As of 27/9/2018, the successful combination is MariaDB 10.2.17 and phpMyAdmin 4.8.2.
  3.  
  4. #Get necessary packages for both programs (phpmyadmin need new ctype package)
  5. opkg install mariadb-server mariadb-server-extra mariadb-client mariadb-client-extra php7-mod-mysqli php7-mod-mbstring php7-mod-json php7-mod-session php7-mod-ctype
  6.  
  7. #Edit 2 lines in /opt/etc/mysql/my.cnf
  8. user = admin #default superuser of mysql is "root", change this to match the one of the router to allow create basic databases
  9. bind-address = 0.0.0.0 #to enable TCP/IP connection mode of mysql instead of socket mode, some even said to comment this line out
  10.  
  11. #Continue to run in terminal:
  12. mysql_install_db --force
  13. /opt/etc/init.d/S70mysqld restart
  14. /opt/bin/mysqladmin -u root password your_desired_mysql_password #yes, it still keeps its superuser "root"
  15.  
  16. #Connect to mysql daemon (also MariaDB) as "root" user to setup some basic things. It is said that some programs would no longer allow "root" user, so we may need to create another super user that has all root/super permissions:
  17. mysql -u root -p
  18. # '%' is connection from any IPs, remote machines..., localhost for local machine
  19. MariaDB> CREATE USER 'new-super-user'@'%' IDENTIFIED BY 'password';
  20. MariaDB> GRANT ALL PRIVILEGES ON *.* TO 'new-super-user'@'%' WITH GRANT OPTION;
  21. MariaDB> FLUSH PRIVILEGES;
  22.  
  23. #you may want to create a database for Nextcloud/Owncloud/Wordpress...:
  24. MariaDB> CREATE DATABASE your-db-name;
  25.  
  26. #exit mysql
  27. MariaDB> exit;
  28.  
  29. #Important: if you don't disable anonymous login mode, you can't connect your created users to MariaDB-mysql daemon with passwords (got Access Denied) but you can *without* passwords (i.e. just enter to provide blank passwords!). By defaults, phpMyAdmin doesn't allow anonymous login. So, with that reason, and for security, obviously we should disable anonymous mode via this command. It would allow us to set other security settings too:
  30.  
  31. /opt/bin/mysql_secure_installation
  32.  
  33. #Commands to install the new phpMyAdmin:
  34. cd /opt/share/www/
  35. wget https://files.phpmyadmin.net/phpMyAdmin/4.8.2/phpMyAdmin-4.8.2-all-languages.zip --no-check-certificate
  36. unzip phpMyAdmin-4.8.2-all-languages.zip
  37. mv ./phpMyAdmin-4.8.2-all-languages ./phpmyadmin
  38. rm ./phpMyAdmin-4.8.2-all-languages.zip
  39. cp /opt/share/www/phpmyadmin/config.sample.inc.php /opt/share/www/phpmyadmin/config.inc.php
  40. chmod 644 /opt/share/www/phpmyadmin/config.inc.php
  41. sed -i 's/localhost/127.0.0.1/g' "/opt/share/www/phpmyadmin/config.inc.php"
  42.  
  43. #You might need to add the port to iptables. (Default MariaDB port: 3306)
  44. iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT
  45.  
  46. /opt/etc/init.d/S80lighttpd restart
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement