I am trying use this guys code: https://github.com/daveismynamecom/loginregister in a xampp enviroment. My first error was a connection error. It was easy to solve and just had to cahnge the connection PDO in the config file. Now I get a
SQLSTATE[HY000] [1045] Access denied for user 'database username'#'localhost' (using password: YES)
error. I have looked at every stack q&a and have not found an answer. I didnt change the code from this guys website other than the PDO. any help would be great. Also this was my first time install xampp and I didnt have msql or php before this
[edit] I have never used mysql so how would you set up root permissions and setup a root user. I can log in to the root user from the mysql console by leaving the password blank but I don't know if that is it
[edit v2] I needed to add the user :). Did not know that. but now I am getting a error code 1044 but that is a question for another time
It's not about the code itself - that error comes directly from your MySQL server. Check whether your credentials (user/pass) are correct.
[edited]
I have never used mysql so how would you set up root permissions and setup a root user. I can log in to the root user from the mysql console by leaving the password blank but I don't know if that is it
So did you set a blank password in the config file as well?
Related
I am trying to connect to my db through phpmyadmin but I can't get connected no matter what solutions I try.
I am able to connect to the phpmyadmin screen but when I try to access my webpage I am met with the error.
Here it is expanded.
mysqli::__construct(): (HY000/1045): page error
I'm trying to access the path xampp/htdocs/pfs (my site).
I am using port 4306
xampp config panel
my username/password is root and no password
config.inc.php file
db_connection.php file
Here's my phpmyadmin root user information too
phpmyadmin
Is there another file path the phpmyadmin reads username/password information from that I'm missing ? Or am I trying to access my webpage in the incorrect way ? I can't figure this one out.
If anyone can help I'd appreciate it.
I've tried about 20 thread solutions from stackoverflow that were titled with the mysqli::__construct(): (HY000/1045): error
I am expecting to be able to view my webpage through htdocs and then be able to show CRUD statements.
Here's what I tested.
Changed port to 4306 in xampp config, config.inc.php and sql my.ini file
Changed password to root & " " in both db_connection.php and config.inc.php (this stopped me from accessing phpmyadmin altogether)
Changed hostname to localhost:4306 (this stopped me from accessing phpmyadmin altogether)
you need to add database name in mysqli function call:
$mysqli = new mysqli("localhost","root","","database_name");
https://www.php.net/manual/en/mysqli.construct.php
I'm currently making a simple app using Laravel and Xampp. While trying to connect the database and make migrations I got this error message from php artisan:
PHP error
So I decided to configure the database manually from the MySQL MariaDB shell (having started the session as the root user), but regardless of what user I try to gran privileges to on any database I get the following error:
MariaDB error
The only possible reason I can come up with is the fact that there seems to be two different root user listed, but I don't thisnk this is the root of the problem, since I'm starting the shell as root, and not choosing one of these after starting.
User List
I've already triple-checked my root user password (I've been starting the shell with this command mysql -u root -p -h 127.0.0.1). Trying to do this through the PHP MyAdmin interface yields the same error.
I'd appreciate any insights, thank you!
The multiple entries for 'root' are specifying which host addresses are allowed connections from (127.0.0.1 and % respectively)
Your error appears to be because your configured database connection (in Laravel) is using the user 'usario'. Search your files for where usario is defined and input the proper credentials to connect to your database in its place.
This is a common error when credentias supplied to MySQL/MariaDB are simply invalid. Bad username, bad password, or both. In this instance it looks as though you're trying to run a migration with a user that doesn't exist.
I am using Xampp that has phpmyadmin. When I try to open phpmyadmin I get this error:
mysqli::real_connect(): (HY000/1045): Access denied for user 'root'#'localhost' (using password: NO)
In my config file the password is "" so nothing basically.
I have added the screenshot as well for the error. How can I fix it? I tried all the other answer of SO but nothing worked for me.
It seems what you are really asking is how to change the root password since you dont know the one that is in place.
The error you get is simply mysql saying, "ya need a password mate"
A quick google leads me to something like this, which seems reasonable https://gist.github.com/susanBuck/39d1a384779f3d596afb19fcad6b598c
Start mysql without the grant tables and change the password. Restart it again, and you should be good to go. I do not have Xampp or Windows, so i cant try it.
The password you are looking for should be written in the mysqld.log from when it was installed. That might save you some trouble changing it. Search the log file for "temporary password"
I want to build a website on Ubuntu 14.
I have apache, PHP and Mysql installed on it.
I'm using PHP to connect to Mysql but got the error information as follows:
Connection Failed: SQLSTATE[28000][1045] Access denied for user 'root'#'localhost'
Anyone know how to fix it?
Probabbly Wrong Password issue or you didn't set the password for root yet. Try login from terminal using mysql -u root -p and it will asking your current root password.
If you are running a website, do not using root access for your website user access. Create an account with access to specified database.
I'm trying to simply run php artisan migrate --seed on a new Laravel project but everytime I try, I get the error:
SQLSTATE[HY000] [1045] Access denied for user 'appuser'#'localhost' (using password: YES)
I check my database config file and the correct username and password for the database are there.
I check MySQL Workbench, and the correct user is there with all the schema privileges for the same password.
I tried adding the user with privileges under %, localhost and 127.0.0.1 but same access denied error.
I ran a quick check to make sure Laravel was selecting the right environment for the database connection details and it is.
I've created users hundreds of times and never had this problem. This all started after I updated to the latest MySQL Workbench 6.1.7 after the older version stopped working correctly on Windows 8. Sadly, I don't have the option to even go back and test if the old version fixes the problem since it won't work at all.
At this point I can't get any new database users to connect.
The database server is up and running, and every other previously existing user still connects just fine.
Here is the my.ini file.
Any ideas? I'm hoping I'm just tired and missing something obvious here.
by reading the config file.
[client]
password = mysql
port = 3306
socket = "{$path}/mysql/mysql.sock"
i think you need to comment the string with default password. Probaby it affects something.
I have recent MariaDB, and the password string is commented out in every config file example