ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)

The following steps are to reset the password for a user in case you forgot, this would also solve your mentioned error.

First, stop your MySQL:

sudo /etc/init.d/mysql stop

or

sudo service mysqld stop

Now start up MySQL in safe mode and skip the privileges table:

sudo mysqld_safe --skip-grant-tables &

and then Login with root:

mysql -uroot

And assign the DB that needs to be used:

use mysql;

Now all you have to do is reset your root password of the MySQL user and restart the MySQL service:

update user set password=PASSWORD("YOURPASSWORDHERE") where User='root';

flush privileges;

quit and restart MySQL:

quit

sudo /etc/init.d/mysql stop sudo /etc/init.d/mysql start Now your root password should be working with the one you just set, check it with:

mysql -u root -p


and....

walaaaaa...

it works!!!
Advertisements

Cara Install Phalcon Di Ubuntu 16.04

Pada kesempatan kali ini saya akan berbagi kepada sobat tentang cara Install Phalcon Di Ubuntu 16.04 tentu saja cara ini tidak sama seperti halnya kita Install Phalcon Di Ubuntu 14.04. Sebelum sobat menginstall ini pastikan dahulu sobat mengenal phalcon jika belum kenal sobat bisa baca artikel saya sebelumnya tentang Perkenalan Framework Phalcon dan saya akan membuat tutorial series yang artinya setiap artikel yang satu dengan yang lain saling berkaitan. Nantikan tulisan saya lainnya tentang Tutorial Phalcon yang lainnya.

Yang berbeda cara installasi phalcon diubuntu 14.04 & ubuntu 16.04 adalah versi php yang berbeda. Perlu kalian ketahui bahwa ubuntu 16.04 hanya support menginstall dan menggunakan php7 , sementara ubuntu 14.04 menggunakan php 5. Tentu sangat berbeda apabila kita install ubuntu 16.04 dengan cara ubuntu 14.04.

1. Install LAMP-stack (Apache2, Mysql, Php 7)
Untuk cara penginstallan tidak akan saya jelaskan disini karena akan menjadi artikel yang sangaat panjang hahaha untuk saya rekomendasikan sobat untuk bisa ikuti cara di : http://tecadmin.net/install-apache-mysql-php-lamp-stack-on-ubuntu-16-04/
Setelah berhasil Install LAMP-stack kita akan mulai melakukan instalasi phalcon diharap untuk ikuti baik-baik step-by-stepnya.

2. Installasi Phalcon Ubuntu 16.04
Masukan command dibawah ini melalui terminal sobat secara bertahap satu per-satu.

 

$ sudo apt-add-repository ppa:phalcon/stable
$ sudo apt-get update
$ sudo apt-get install php7.0-phalcon
$ sudo apt-get install -y gcc make re2c libpcre3-dev php7.0-dev build-essential php7.0-zip

 

3. Aktifkan Extensi Phalcon
$ sudo apt-get install gcc make autoconf libc-dev pkg-config
$ git clone --depth=1 git://github.com/phalcon/cphalcon.git
$ cd cphalcon/build
$ sudo PATH=/opt/sp/php7.0/bin:$PATH ./install
4. Tambahkan Extensi Phalcon Ke Apache
$ sudo bash -c "echo extension=phalcon.so > /etc/php7.0/conf.d/phalcon.ini"
$ sudo service php7.0-fpm restart

 

5. Cek Ekstensi Phalcon.
Cek ekstensi phalcon apakah sudah aktif atau belum.
Runing terlebih dahulu Apache2 sobat “sudo service apache2 start”
lalu buat file php.info didirektori default apache2 /var/www/html/ cari ekstensi phalcon ctrl + f phalcon.
Selamat! Kini Phalcon v.3.0.1 telah diinstall diubuntu 16.04 sobat silahkan untuk terbang bersama phalcon ?

How To Install Apache MySQL PHP (LAMP Stack) on Ubuntu 16.04

LAMP (Linux, Apache, MySQL and PHP ) Stack is the most popular environment in PHP website development and hosting. Linux is the operating system, Apache is the popular web server developed by Apache Foundation. MySQL is relational database management system used for storing data and PHP is an development language.

This article will help you to Install Apache 2.4, MySQL 5.7 and PHP 7.0 . on Ubuntu 16.04 LTS Systems.

Step 1 – Install PHP

PHP 7 is the default available packages in Ubuntu 16.04 repositories. Simply use the following commands to update apt cache and install PHP packages on your system.

$ sudo apt update
$ sudo apt install -y php

Verify installed PHP version using following command.

rahul@tecadmin:~$ php -v

PHP 7.0.4-7ubuntu2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Step 2 – Install Apache2

After installing PHP on your system, let’s start installation of Apache2 in your system. Your also required to install libapache2-mod-php module to work PHP with Apache2.

$ sudo apt install apache2 libapache2-mod-php

Step 3 – Install MySQL

Finally install mysql-server packages for MySQL database. Also install php-mysql package to use MySQL support using php. Use following command to install it.

$ sudo apt install mysql-server php-mysql

Installer will prompt for root password, This password will work for your MySQL root user. After installing MySQL execute following command for initial settings of MySQL server. You will she that script will prompt about more settings than earlier mysql versions like password validation policy etc.

$ sudo mysql_secure_installation

Step 4 – Restart Apache2, MySQL Services

After installing all services on your system, start all required services.

$ sudo systemctl restart apache2.service
$ sudo systemctl restart mysql.service

Step 5 – Open Access in Firewall

If you are using iptables, Use following commands to open port 80 for public access of webserver.

Iptables Users:

$ sudo iptables -A INPUT -m state --state NEW -p tcp --dport 80 -j ACCEPT

UFW Users:

$ sudo ufw allow 80/tcp

Step 6 – Test Setup

After completing all setup. Let’s create a info.php file website document root with following content.


Now access this file in web browser. You will see the screen like below with all details of PHP on server.

lamp-on-ubuntu-16.04

Congratulation’s! You have successfully configured web server on your ubuntu System.

credit : https://tecadmin.net/