I have been working with my Laravel Project and so far everything looks really good. Except that during my testing of a Delete Item Button it did not work as expected. The item i tried to delete still persist in the browsers view. I tried to check it out inside the database and investigate further. I run phpmyadmin in my Ubuntu 18.04 system and when I click on the Table i was working on and hit the browse button the Error Appeared. Continue reading “Parameter must be an array or an object that implements Countable Error in phpmyadmin”
I was having a really difficult time getting into Mysql after I first install it in my ubuntu 18.04 box. Please see below steps I made in installing mysql-server
The short version of the installation is simple: update your package index, install the mysql-server package, and then run the included security script.
sudo apt update sudo apt install mysql-server sudo mysql_secure_installation
How to install LAMP in Ubuntu 14.04
I wanted to setup a LAMP stack on my Ubuntu. I was kind of hopin that it would be just a walk in the park as what i did with windows WAMP. I tried googling the steps and did find some nice tutorials. I will walk you through with my installation and hope i’d be successfull with this exercise.
So lets get it on
Step 1 : — Install Apache
First though we need to update our system
sudo apt-get update
Then we can install apache
sudo apt-get install apache2
After the installation you can open your browser and in the address bar just type
And it says “It works!” hehehe, you can take a deep breath for now
Note : After you installed apache2 it will create the document root directory at /var/www/html
Step 2 : Install Mysql
sudo apt-get install mysql-server php-mysql
Notice that we added “php5-mysql” so that php5 and mysql can properly communicate with each other (“some helper tools”).
mysql -u root -p Enter password: "here you type your password"
then you should see the server verion of your mysql and other stuff. Just type “exit” to go back to command prompt.
We need to execute and tell MYSQL to create its database directory structure where it will store its information.
Then secure your mysql installation especially in actual production mode
You will be ask security questions. I answered “Y” for all of its questions hehehe just bring it on.
Step 3 : Install PHP
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
After installation you can start with a project by creating an html file at “/var/www/html”. By default apache would give priority to index.html file but we all want to give hail to index.php. So to do that we edit dir.conf
sudo nano /etc/apache2/mods-enabled/dir.conf
It should return something like this
DirectoryIndex index.html index.cgi index.php index.pl index.xhtm$
So change the order, put index.php first on the list like this
DirectoryIndex index.php index.html index.cgi index.pl index.xhtm$
Then save. Ctrl – X then “Y”
It is important to notice that we change some behavior of apache2 to identify .php prior to .html and others, so we need to restart the service for the change to take effect.
sudo service apache2 restart
Then install php modules ( check for available modules )
apt -cache search php5-
Next step is testing the PHP
create a file named test.php in “/var/www/html” and inside test.php write
Then open the browser ahd in the address bar type
Yes we did it! we did it! Time to coooooooooooooooooode! Good day everyone!
Edit the my.cnf file
# vi /etc/my.cnf
[mysqld] user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp language = /usr/share/mysql/English bind-address = 126.96.36.199 # skip-networking <-- make sure to comment out this line
Restart mysql service
service mysqld restart
———– and that’s it 🙂 enjoy ——————–
GRANT ALL PRIVILEGES ON dbTest.* To ‘user’@’hostname’ IDENTIFIED BY ‘password’;
If you are running the code/site accessing MySQL on the same machine, hostname would be localhost.
Now, the break down.
GRANT – This is the command used to create users and grant rights to databases, tables, etc.
ALL PRIVILEGES – This tells it the user will have all standard privileges. This does not include the privilege to use the GRANT command however.
dbtest.* – This instructions MySQL to apply these rights for the use onto the full dbtest database. You can replace the * with specific table names or store routines if you wish.
TO ‘user’@’hostname’ – ‘user’ is the of the user account you are creating. Note: You must have the single quotes in there. ‘hostname’ tells MySQL what hosts the user can connect from. If you only want it from the same machine, use localhost
IDENTIFIED BY ‘password’ – As you would have guessed, this sets the password for that user.
C.5.4.1. How to Reset the Root Password
If you have never set a root password for MySQL, the server does not require a password at all for connecting as root. However, this is insecure. For instructions on assigning passwords, see Section 2.18.2, “Securing the Initial MySQL Accounts”. Continue reading “Reset Root Password ‘MySQL’”
Back up From the Command Line (using mysqldump)
If you have shell or telnet access to your web server, you can backup your MySQL data by using the mysqldump command. This command connects to the MySQL server and creates an SQL dump file. The dump file contains the SQL statements necessary to re-create the database. Here is the proper syntax: Continue reading “Backup/REstore MySQL database in Command Line Using mysqldump”