Unique 1045 Error
Posted by: umarjidda (197.253.30.---)
Date: September 20, 2016 05:22PM

Hello,
I have two instances of mysql on my computer- so I had to change the mysql port on WAMP.
I successfully changed WAMP from 3306 to 3309. I modified the port values on my.ini, config.inc.php, php.ini. Cleared browser cache. And the 1045 Error which was showing went away.

Now I can access phpmyadmin ok - I can browse through, create db and all.

Now here is the main problem:
from within my code I have a db connection script which does a simple mysqli_connect(localhost, root, '', mydb1); call, but it keeps returning a 1045 Access denied for user root@localhost Error.

However, as I said earlier, I can open phpmyadmin on the browser. Any help will be really appreciated.

Options: ReplyQuote
Re: Unique 1045 Error
Posted by: Otomatic (Moderator)
Date: September 20, 2016 05:51PM

Hi,

As you use two MySQL, you must use port number in the mysqli_connect() function.

Note 1 : use 127.0.0.1 instead of localhost.

Note 2 : You should have change the port by MySQL option available in Wampmanager tools. By not doing so, the MySQL port numbers are not changed in the Wampmanager configuration file.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Unique 1045 Error
Posted by: RiggsFolly (Moderator)
Date: September 20, 2016 08:17PM

As to connecting to a non standard port number see the MYSQL manual [php.net]

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.