FIX: SQLSTATE[HY000] [1045] Access denied for user ‘root’@’localhost’ (using password: NO)

Error: SQLSTATE[HY000] [1045] Access denied for user ‘root’@’localhost’ (using password: NO) Scenario: After very first setup of your own wamp/xamp with MySQL DB and updated password for DB root user, you notice that your php code fails to connect/communicate to the mySQL DB with above error.   CAUSE and FIX: This error message indicates that you are attempting to connect/logon to the MySQL with reported user “root” without specifying any password or it’s password value is NULL.   To fix it, you need to provide the appropriate root user password for on your MySQL DB connection string or call.   […]

Read more

Creating new Database and a new table in MySQL via PhpMyAdmin

Login to your PhpMyAdmin page,   Syntax: SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; CREATE DATABASE `DialogDB` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `<MyDBName>`; CREATE TABLE IF NOT EXISTS `<MyTableName>` (   `userID` int(11) NOT NULL AUTO_INCREMENT,   `username` varchar(50) NOT NULL,   `password` varbinary(250) NOT NULL,   PRIMARY KEY (`userID`,`username`) ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;   Example:   Output: SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";# MySQL returned an empty result set (i.e. zero rows). SET time_zone = "+00:00";# MySQL returned an empty result set (i.e. zero rows). CREATE DATABASE `DialogDB` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;# 1 row affected. USE `DialogDB`;# MySQL […]

Read more

Starting up Web Development in Php scripting language on Windows

The foremost to I learned is that many of the Php development tools/resources/projects refer setting php in WAMPServer (Windows AMP) that comes bundled with all of a required components for a Web site development which include: Web Server: Apache Database: MySQL Scripting Language: PHP Refer to: Installing WampServer 2 on Windows   In case if you are looking to setup your PHP web pages within IIS web server, then you need to explicitly download, install and configure the respective equivalent components in Windows. Refer to:  Configuring PHP to run in Windows IIS Web Server

Read more