Tuesday, August 21, 2018

CodeIgniter: The requested URL was not found

When you use router on your web application (bramus/code igniter/etc), sometimes you found that the url redirect showing error message:

Codeigniter “The requested URL was not found” error

Bramus “The requested URL was not found” error

Router “The requested URL was not found” error

the solutions is simple, you need to modify the php settings on apache2

  1. set enable rewrite url >> sudo a2enmod rewrite
  2. set AllowOveride All on the configuration >> edit apache2.conf
  3. restart apache >> sudo systemctl restart apache2
your application run well afterthat



Monday, August 20, 2018

upgrade phpmyadmin version

sometimes the phpmyadmin stored in repository is not the updated version, so you need to upgrade manually, don't worry it so easy as you copy and paste a directory in a computer

  1. download the most updated version from https://www.phpmyadmin.net/
  2. backup the /usr/share/phpmyadmin into another directory
  3. select all files inside /usr/share/phpmyadmin and delete them
  4. extract the downloaded file into the /usr/share/phpmyadmin
that's all, and your phpmyadmin has updated, no need to restart the apache engine.

this solution is also applied and solved the phpmyadmin compatibility issue showing the error:

“Warning in ./libraries/sql.lib.php#613 count(): Parameter must be an array or an object that implements Countable”

Thursday, May 24, 2018

phpmyAdmin and MySQL Server

This happened to me, when I installed mysql-server then install phpmyadmin, I face this problem when accessing the address localhost/phpmyadmin: "mysqli_real_connect(): (HY000/1698): Access denied for user 'root'@'localhost'" and "#1698 - Access denied for user 'root'@'localhost'"

this happened because the new configuration of mysql-server and phpmyadmin, for security reason, do not allow root user to access remotely by default.

try this steps:

  1. configure the mysql-server, add a new user "pma" (phpMyAdmin) or "pmauser"
    1. login to your mysql console using terminal:
      mysql -u root -p
    2. insert your root password
    3. execute this commmand, change the 'yourpassword' to preferred one:
      Create user 'pmauser'@'%' identified by 'yourpassword';
    4. make sure that your new user had been created:
      select host, user, authentication_string from mysql.user;
    5. grant privilege to your new user, be aware that this command grants pmauser as superuser as root have: GRANT ALL PRIVILEGES ON *.* TO 'pmauser'@'%';


  2. configure the phpmyadmin config to use the created user
    1. go to /etc/phpmyadmin
      1. cd /etc/phpmyadmin
    2. edit the config-db.php file
      1. sudo gedit config-db.php
      2. edit the user (pma/pmauser) and password as we created before
      3. save the file


  3. refresh the page and login





Thursday, May 17, 2018

Totally uninstall and remove configuration MySQL Server Ubuntu 18.04

When you uninstall MySQL for any purpose and reinstall the MySQL Server, perhaps you want to fresh install for all the configuration, but you found that the configuration still remains.

Try this lists accordingly:

sudo service mysql stop  #or mysqld
sudo killall -9 mysql
sudo killall -9 mysqld
sudo apt-get remove --purge mysql-server mysql-client mysql-common

sudo deluser -f mysql
sudo rm -rf /var/lib/mysql
sudo apt-get purge mysql-server-core-5.7
sudo apt-get purge mysql-client-core-5.7
sudo rm -rf /var/log/mysql
sudo rm -rf /etc/mysql

sudo apt-get autoremove
sudo apt-get autoclean

Install MySQL Server on Ubuntu 18.04



In case we need to install mysql server on ubuntu (18.04 LTS used as case), follow the instruction
  1. Install MySQL Server
    • sudo apt-get update
    • sudo apt-get install mysql-server

    1. Allow the remote access
      • sudo ufw allow mysql

      1. Start MySQL Server
        • sudo systemctl start mysql

        1. Set MySQL to launch at reboot
          • sudo systemctl enable mysql

          1. Set MySQL password
            • sudo /usr/bin/mysql -u root -p
            • mysql> use mysql;
            • mysql> UPDATE user SET authentication_string=PASSWORD('yourpassword') WHERE User='root';
            • mysql> FLUSH PRIVILEGES;