opencart installation issue on step 3 windows - php

i cannot install opencart on third step.i have the following problem:
Warning: mysqli::mysqli(): (HY000/1045): Access denied for user
'root'#'localhost' (using password: NO) in
C:\wamp\www\opencart\upload\system\library\db\mysqli.php on line
7Warning: DB\MySQLi::__construct(): Couldn't fetch mysqli in
C:\wamp\www\opencart\upload\system\library\db\mysqli.php on line
10Warning: DB\MySQLi::__construct(): Couldn't fetch mysqli in
C:\wamp\www\opencart\upload\system\library\db\mysqli.php on line
10Notice: Undefined variable: mysql in
C:\wamp\www\opencart\upload\install\controller\install\step_3.php on
line 280Notice: Trying to get property of non-object in
C:\wamp\www\opencart\upload\install\controller\install\step_3.php on
line 280
php× 1144494

If someone is getting same type of error ,you could try out this,
username=admin
password=
keep your password null
The reason this might happened is because of password you gave in phpmyadmin during setting time.

Related

Error Establishing Database Connection on WordPress site in CyberPanel

I suddenly started getting an 'Error establishing a database connection' on the load of my WooCommerce site which is hosted on CyberPanel under Centos 8.
To understand what's going on, I've put the following in wp_config.php:
define('WP_ALLOW_REPAIR', true);
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true);
That uncovered the following stack trace:
( ! ) Warning: mysqli_real_connect(): (HY000/1045): Access denied for user 'w8WI11xxxxGCO'#'localhost' (using password: YES) in /home/example.com/public_html/wp-includes/wp-db.php on line 1653
Call Stack
# Time Memory Function Location
1 0.0009 372512 {main}( ) .../repair.php:0
2 0.0012 373000 require_once( '/home/example.com/public_html/wp-load.php' ) .../repair.php:10
3 0.0015 373400 require_once( '/home/example.com/public_html/wp-config.php' ) .../wp-load.php:37
4 0.0025 374800 require_once( '/home/example.com/public_html/wp-settings.php' ) .../wp-config.php:84
5 0.0546 832240 require_wp_db( ) .../wp-settings.php:124
6 0.0610 836424 wpdb->__construct( ) .../load.php:527
7 0.0610 836424 wpdb->db_connect( ) .../wp-db.php:632
8 0.0611 838000 mysqli_real_connect ( ) .../wp-db.php:1653
Access denied for user 'w8WI11xxxxxGCO'#'localhost' (using password: YES)
Error establishing a database connection
I seem to be able to access the DB via the phpMyAdmin UI through CyberPanel and there I can see that in the DB that seems to be associated with my WordPress app (w8WI11xxxxGCO) there's an option to change a password at the following URL: https://example.com:8090/phpmyadmin/server_privileges.php?username=w8WI11xxxxGCO&hostname=<myIP>.
I attempted to change the password to the one in the wp_config.php.
After rebooting Lightspeed server and retry, the erroneous behavior still persists.
How can I recover from this?
Why wouldn't the application start while the DB is perfectly accessible via phpMyAdmin?
I'd appreciate if anyone could guide me at fixing this issue.
Thank you in advance.
P.S. I also tried configuring this user to have no password and granting him all privileges, but that doesn't change the situation either, except for the error message now reading as:
Warning: mysqli_real_connect(): (HY000/1045): Access denied for user 'w8WI11xxxxxGCO'#'localhost' (using password: NO) in /home/example.com/public_html/wp-includes/wp-db.php on line 1653
I've then decided to run the following script from the command line against the DB:
which confirmed that something in CyberPanel messed up the credentials somehow:
PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user 'w8WI11xxxxxGCO'#'localhost' (using password: YES) in /home/example
.com/public_html/testConnection.php on line 2
PHP Stack trace:
PHP 1. {main}() /home/example.com/public_html/testConnection.php:0
PHP 2. mysqli_connect() /home/example.com/public_html/testConnection.php:2
PHP Warning: mysqli_error() expects exactly 1 parameter, 0 given in /home/example.com/public_html/testConnection.php on line 4
PHP Stack trace:
PHP 1. {main}() /home/example.com/public_html/testConnection.php:0
PHP 2. mysqli_error() /home/example.com/public_html/testConnection.php:4
Could not connect: [root#example ~]#
I would be very curious to find what in CyberPanel messes up the configuration in such a way that corrupts the DB credentials and doesn't allow them to be restored.
Perhaps someone (hopefully representing the CyberPanel team or having enough knowledge of it) could shed some light on their product for me here.

php can not connect to mysql after reboot server

Software:
PHP 7.3
MySQL Workbench 8.0
This is my PHP code:
try {
$link = mysqli_connect($DB_SERVER,$DB_USERNAME, $DB_PASSWORD,$DB_NAME,3306);
} catch (Exception $e){
throw new Exception("Can't execute command. ERROR: ".$e);
}
This is the error:
Warning: mysqli_connect(): PHP was built without openssl extension, can't send password encrypted in login.php on line 11
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'XXXXX_admin'#'localhost' (using password: YES) in C:\inetpub\wwwroot\ on line 11
PHP Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in C:\inetpub\wwwroot\ on line 24
PHP Fatal error: Uncaught Exception: ERROR: Failed to connect to in C:\inetpub\wwwroot:24 Stack trace: #0 {main} thrown in C:\inetpub\wwwroot\ on line 24
Now the magic, when I login in to mysql workbench with the same user and password everything works fine. I have access to tables and other things. When I login in with my PHP application everything works also.
So my problem is everytime my server reboots I have to login in with MySQL Workbench, to get it working again. What am I missing?
You need to do verify few of the steps:
All necessary extensions are enabled like mysqli, openssl etc
Port is available
MySQLi is connecting at 3306 Port
Rest could be your username and password issue
Let us know once you will be verifying all above steps.
What you need to do is enable the openssl extension for php.
Open your php.ini file and search for the line:
;extension=php_openssl.dll
You need to uncomment it by removing the semicolon in front of it, leaving you with this:
extension=php_openssl.dll

Weird error on connection with database

I have a custom application written on php, which is connecting with database. If I run it on the windows wamp server the application is connect correct with the database. If I run it on the ubuntu apache2 i am getting the following error:
<b>Warning</b>: mysqli::real_connect(): (28000/1045): Access denied for user 'user'#'localhost'
(using password: YES) in <b>/var/www/html/reportCMS/php/classes/Database.class.php</b> on line <b>137
</b><br />
<br />
<b>Warning</b>: mysqli::set_charset(): invalid object or resource mysqli
in <b>/var/www/html/reportCMS/php/classes/Database.class.php</b> on line <b>141</b><br />
<br />
<b>Warning</b>: mysqli::prepare(): invalid object or resource mysqli
in <b>/var/www/html/reportCMS/php/classes/Database.class.php</b> on line <b>829</b><br />
<br />
<b>Fatal error</b>: Problem preparing query (SELECT id,username,password,type from user WHERE BINARY
username=? AND active=1 ) Access denied for user 'user'#'localhost' (using password: YES) in <b
>/var/www/html/reportCMS/php/classes/Database.class.php</b> on line <b>830</b><br />
And the Database.class.php line 137 is:
$this->_mysqli = mysqli_init();
$this->_mysqli->real_connect( $this->host, $this->username, $this->password, $this->db, $this->port );
$this->_mysqli->set_charset ('utf8');
The connection with database in both cases, is on the ubuntu machine with mysql.
Can you guide me, how to find the error? If you need more information please tell me.
EDIT:
The only difference is on the config file for the permissions, which on the ubuntu is localhost. And on the windows machine is the IP of the ubuntu. But I have grant the permission both for localhost and % on the mysql.
EDIT2:(for the # anant kumar singh suggestion)
Warning: mysqli::real_connect(): (HY000/1045): Access denied for user 'user'#'myip' (using password: NO) in C:\wamp\www\reportCMS\php\classes\Database .class.php on line 138
Warning: mysqli::set_charset(): invalid object or resource mysqli in C:\wamp\www\reportCMS\php\classes\Database.class.php on line 142
Warning: mysqli::prepare(): invalid object or resource mysqli in C:\wamp\www\reportCMS\php\classes\Database.class.php on line 830
Fatal error: Problem preparing query (SELECT id,username,password ,type from user WHERE BINARY username=? AND active=1 ) Access denied for user 'user'#'myip (using password: NO) in C:\wamp\www\reportCMS\php\classes\Database.class.php on line 831
Finally I solved it. My mistake was that the config file(username, password, db) is created on Windows. Because of that there some whitespaces insert on the file, I remove it from the Ubuntu with the Netbeans and it worked.

Synology MSQL connection error

I tried to move a database from XAMPP to my Synology NAS.
Now I get this error:
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'qs'#'localhost' (using password: YES) in /volume1/web/db.php on line 3
In the Database i created a User:
Name: qs
password: test
host: %
privileges: all..
in php i use:
$link=mysqli_connect("localhost","qs","test","qs",3306);
localhost because the Synology is the localhost of the web-page. i also tried to change to:
$link=mysqli_connect("10.0.0.99","qs","test","qs",3306);
then it says:
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'qs'#'JF_SYN' (using password: YES) in /volume1/web/db.php on line 3
"JF_SYN" is the name of my Synology
i also tried to set the host of the database user, to that specific IP, but that doesn't change anything.
Database connection is working with this user and the password, i tried with HeidSQL,MSYQL-Workbench and Oracle SQL Developer, all those tools can make a connection.
I had the same issue, with my Synology NAS
Use MyAdmin and remove the “ANY” or “Anonymous” user accounts.
This should Fix your issue.

Problem Connecting to MySQL Database on Production Server

I put my files on my server, but I'm unable to connect to the database. My project works on my local machine, but not on my production server.
I'm using mysql and php.
I'm getting this error:
[01-Nov-2010 18:27:01] PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'dbuser'#'localhost' (using password: YES) in /home/mysite/public_html/zendamf_remote_quiz/MyData.php on line 20
[01-Nov-2010 18:27:01] PHP Warning: mysql_select_db() [<a href='function.mysql-select-db'>function.mysql-select-db</a>]: Access denied for user 'mysite'#'localhost' (using password: NO) in /home/mysite/public_html/zendamf_remote_quiz/MyData.php on line 21
[01-Nov-2010 18:27:01] PHP Warning: mysql_select_db() [<a href='function.mysql-select-db'>function.mysql-select-db</a>]: A link to the server could not be established in /home/mysite/public_html/zendamf_remote_quiz/MyData.php on line 21
[01-Nov-2010 18:27:01] PHP Warning: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Access denied for user 'mysite'#'localhost' (using password: NO) in /home/mysite/public_html/zendamf_remote_quiz/MyData.php on line 28
[01-Nov-2010 18:27:01] PHP Warning: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: A link to the server could not be established in /home/mysite/public_html/zendamf_remote_quiz/MyData.php on line 28
[01-Nov-2010 18:27:01] PHP Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/mysite/public_html/zendamf_remote_quiz/MyData.php on line 31
[01-Nov-2010 18:27:01] PHP Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/mysite/public_html/zendamf_remote_quiz/MyData.php on line 46
Does this error mean that my password is incorrect? Any suggestions?
Thank you.
-Laxmidi
Either your user or password is wrong (or even your server, but that's more rare).
Be aware that there are two users on that stacktrace, 'dbuser' and 'mysite', could be related to that?
Thank you for the help. I made a dumb error. My host prefaces the user name and the database name with the site's user name in order to avoid conflicts. I forgot about that.

Categories