How do I get phpMyAdmin to connect to a local mysql server? - mysql

I have my config.inc.php file, and have set my host name to localhost. Unfortunately, I have no idea what my username/password should be. Is that something I need to configure on the MySql side? I tried creating an arbitrary username/password (admin/password), but when I try to log into phpMyAdmin with those credentials, I get an error: (#1045 - Access denied for user 'admin'#'localhost' (using password: YES))
Can anyone point me in the right direction? (Sorry for the dumb question; I just haven't had to install mysql before. I've always had a host name / username / password given to me.)
Thanks!

root with no password.
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed

here you have the default privileges in mysql, and how to change them.
http://dev.mysql.com/doc/refman/5.0/en/default-privileges.html

What installation of mysql are you using? Without knowing that its very hard to know. I would recommend getting the wamp installation and remembering that the usual "normal" installation uses user name: root and no password

I had this problem before, you need to go and look up the password in the config files yourself, since phpMyAdmin's interface will hide the password from you. It's a pain... unfortunately I'm too lazy to install it myself and find exactly where it is for you.

Related

MariaDB - Cannot connect to MariaDB instance from Dbeaver using correct password

I am trying to connect to a localhost instance of MariaDb on port 3306.
I'm well aware that root cannot use localhost because of MariaDb specifications so I created
another user from the command line with password 'root' and all privileges granted to my 'test' database:
CREATE USER 'myuser' IDENTIFIED BY 'root';
GRANT USAGE ON *.* TO 'myuser'#localhost IDENTIFIED BY 'root';
GRANT ALL privileges ON `test`.* TO 'myuser'#localhost;
FLUSH PRIVILEGES;
When I try to open a connection from DBeaver with the correct password and username, an error appears:
Access denied for user 'myuser'#'localhost' (using password: YES)
Current charset is windows-1251. If password has been set using other
charset, consider using option 'passwordCharacterEncoding'
Why does it happen? Is it because of some password hashing algorithms mismatch between DBeaver and MariaDB's instance? How do I fix this and connect successfuly?
You have to to go to DriverProperties and enter the encoding you have used to encode password(UTF-8). This is very common when you use docker image to run maria db on your local Refer the below image.
If you wanna fix this warning to all connections (not just single one) you need to configure driver's general properties.
In dbeaver go to Database -> Driver Manager
Edit MariaDB/MySQL driver
Tab Driver properties, Add new User property
passwordCharacterEncoding : UTF-8
Voila, it works for all connections use edited driver
Source: mariaDB driver's parameters
I had the same issue these days and didn’t find an answer online. I know it’s late, but for anyone who’s still suffering from this same problem, it’s seem to be a bug with Dbeaver or could be one...
Everytime I copy and paste the database and the username I get this exactly error! When I type it directly in the field I can connect successfully.
I would try this before getting mad
I think it's an encoding issue.
Before you create a new connection you should check the preferences here: encoding preferences
It worked for me as I changed it to UTF-8.

What is the initial password of MySQL server?

I downloaded MySQL server 5.7 on my computer (first time) to prove it. But the installer asking me for a password for root#localHost that I have no idea where it is.
I saw a page that you can reset the password using the command line, but the command line ask me too for a password.
What I can do?
UPDATE:
You have told me that if I have not set a password , then the server does not require you to enter one, but observe ! I want to configure the program but will not let me continue !
UPDATE (SOLVED): had to reinstall the MySQL server and the problem disappeared ... (Still asking why happened that...)
Thank you all for your responses and comments!
I think that by default there is no password set for root account.
Source
https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html
If you have never assigned a root password for MySQL, the server does not require a password at all for connecting as root. 
Your default account for the connection to the service of phpmyadmin is user: root and no password. That exist for the Security of the databases

Lost Global Privileges on root#localhost in PHPMyAdmin (XAMPP)

Hi all and please help
I have been running XAMPP and PHPMyAdmin for a number of years on my PC. Both have served me well.
This morning I got an warning message basically saying give root a password because it was not secure. I did (or thought I had), but as a result Now all I can view is a database called information_schema.
I initially panicked, but then found that all my other test sites are working ok and I can still access them via their own username and password.
Therefore my question is: Please could anyone tell me how I can grant Global Privileges back on root#localhost? I have tried a number of things all morning but I get greeted either with a Syntax problem or a 1045 error message, saying Access Denied.
I welcome any help or advice. On the bright side, I have a password for root now!
When you change the password on the root userid from within phpMyAdmin, you then have to put that password into the phpMyAdmin config.
So edit \xampp\phpmyadmin\config.inc.php
Find this line
$cfg['Servers'][$i]['password'] = '';
and add the password to it
$cfg['Servers'][$i]['password'] = 'NEW_PASSWORD';
Ok. Sorted. In my case, I discovered that I had another global login and from the User list, I was able to grant global privileges for the root login once again

MySQL said: Documentation #1045 - Access denied for user 'root'#'localhost' (using password: NO)

I installed xampp,but when I tried to run it I got an error as thus:
Error
MySQL said: Documentation
1045 - Access denied for user 'root'#'localhost' (using password: NO)
Connection for controluser as defined in your configuration failed.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
I tried to search on internet for a solution, but I still can't fix my problem. I have already checked whether I used a password or not in config.inc.php file but i have not used any password.Also, when i try to access with a password, I still can't solve this problem.
I hope anyone can help me. .thank you
I had this problem after changing the password for the root user in phpMyAdmin. I know nothing about programming but I solved it by doing the following:
Go to file C:\wamp\apps\phpmyadmin3.2.0.1\config.inc.php (I guess you would replace "wamp" with the name of your server if you're not using Wamp Server)
Find the line $cfg['Servers'][$i]['password']='' and change this to
$cfg['Servers'][$i]['password']='NO'
Try opening phpMyAdmin again, and hopefully the message will now read "Access denied for user 'root'#'localhost' (using password: YES)
Now change the password in the above line to 'yourpassword' (whatever you had set it to before)
Try this:
Open config.inc.php file in the phpmyadmin directory
Find line 21: $cfg['Servers'][$i]['password'] = '';
Change it to: $cfg['Servers'][$i]['password'] = 'your_password';
Restart XAMPP
Reference
Go to the file C:\wamp\apps\phpmyadmin3.2.0.1\config.inc.php
Find the line $cfg['Servers'][$i]['password']='' and change it to
$cfg['Servers'][$i]['password']='root'
where root is the name of the password you had set in this instance
Hope this helps somebody.
Step one: Go to...
C:\xampp\phpMyAdmin
Step Two: Open the config.inc.php file
Step Three: Locate the following information and change the password.
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'ENTER_YOUR_USER_NAME_HERE';
$cfg['Servers'][$i]['password'] = 'ENTER_YOUR_PASS_HERE';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
Here's the solution to getting the 1045 Access denied for user 'root'#'localhost' (using password: NO) in phpMyAdmin.
First here's what happens:
The problem occurs when you change over from using phpMyAdmin with no password and mysql with no root password. You change root in mysql to having a root password. You dutifully change phpMyAdmin's config.ini.php file's $cfg['Servers'][$i]['password']='' line to include your password and restart everything you can find, but phpMyAdmin still can't get through.
The reason is that your browser still contains cookies for phpMyAdmin and those cookies reflect not needing a password to access mysql.
The solution:
Clear out the cookies relating to phpMyAdmin. Its browser specific, but in my Firefox, its under Tools > Page Info > Cookies.
You might need to relog in with phpMyAdmin or use the signon.php script (under /examples in my WAMP install).
Try this:
1. xampp/htdocs/xampp/cds.php
change line 4 to: mysql_connect("localhost","root","enter password here");
change line 64 to: if(!mysql_connect("localhost","root","enter password here"))
From here
reset your mysql password on xampp security page.
restart your mysql service and then access the phpmyadmin page using your password. i tried it. this is working fine for me.
I'm using Linux Mint 18.2 of this writing. I had a similar issue; when trying to load myphpadmin, it said: "1045 - Access denied for user 'root'#'localhost' (using password: NO)"
I found the file in the /opt/lampp/phpmyadmin directory. I opened the config.inc.php file with my text editor and typed in the correct password. Saved it, and launched it successfully. Profit!
I was having problems with modifying folders and files, I had to change permission to access all my files in /opt/lampp/ directory. I hope this helps someone in the future.
I'm afraid there's a conflict with the port number(80). Make sure you don't run some software like Skype that use the same port 80
I think to troubleshoot your problem you should try the following:
Check whether the MySQL service is running (Control Panel --> services)
Use a MySQL client like SQLYOG to check whether you are able to connect to MYSQL Server with the username and password you are using in your code.
Just try a sample php program, which fetches the data from table
Ex. http://www.anyexample.com/programming/php/php_mysql_example__display_table_as_html.xml
1045 - Access denied for user 'root'#'localhost' (using password: NO)
solution:
Step 1: Open Location of you wamp/xampp
Step 2: Go to phpmyadmin
Step 3: Open config.inc.php
Step 4: Change the password to the password set for the MySql server and not anything else in this: $cfg['Servers'][$i]['password'] = ''
Step 5: Restart all services /restart wamp/xampp.
I had this problem with a fresh install of wamp and using only default settings without setting any passwords. I found an incorrect default setting and I solved it by the following steps:
Go to C:\wamp\apps\phpmyadmin4.1.14 (Your phpmyadmin version# may differ)
open the file config.inc in a text editor
find the line: $cfg['Servers'][$i]['host'] = '127.0.0.1';
change it to $cfg['Servers'][$i]['host'] = 'localhost';
save the file
restart all services in wamp
The problem seems to be that someone forgot to make the server and host match in the configuration files.
Try resetting your password since it seems it has changed you can reset your password by going to
C:\xampp\mysql
and clicking on the resetroot.bat file
Then change in the php config file the password back to blank and you should have access again
Open the config.inc.php file in the WAMP phpmyadmin directory
Change the line ['Servers'][$i]['password'] = ''
to
$cfg['Servers'][$i]['password'] = 'your_mysql_root_password';
Clear browser cookies
Then Restart all services on WAMP
This worked for me.
NB: the password to use has to be the MySQL password.....
My.ini from the file #password and #bind-address="127.0.0.1" are commented change the password to root and uncomment bind-address="127.0.0.1" and from the file cds.php change the
mysql_connect("localhost", "root", ""); to
mysql_connect("localhost", "root", "root");
Stop the Mysql services and try login again it got logged in.
I had this same problem after I dropped the special PhpMyAdmin controluser account from MySQL.
I had to update the config.inc.php file and replace the entries for 'controluser' and controlpass' with 'user' and 'password'.
So my file ended like this:
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password']='123456';
If you are using XAMPP rather than WAMP, the path you go to is:
C:\xampp\phpMyAdmin\config.inc.php
On OSX
I had same difficult, but a figure out a solucition
open terminal
put 'cd /Applications/XAMPP/xamppfiles'
put 'sudo ./xampp security'
then put your root password and answer the questions
Check your MySQL Port number 3306.
Is there any other MySQL Install in your system on same port ?
If any installation found the change the port number to any number between 3301-3309 (except 3306)
user name : root
password : ' ' (Empty)
try to go to Windows services and stop the MySQL service
go to your wamp server and click on "restart all services".
Refrsch your browser

PhpMyAdmin password

I get the error #1045 - Access denied for user 'root'#'localhost' (using password: NO)
after I accidentaly changed the password in phpmyadmin for root and 127.0.0.1 . the problem is i cannot change common.lib.php. I want to revert these changes in mysql somehow... Doe to the security of the server i cannot change much
I hope you can access the mysql server administration. As I know the root is the main user in MySQL it'll be a problem if you cannot access it. If you have a user with the same level, try to change the password there if possible.
Here's the step on how to reset the root password in MySQL
How to Reset the Root Password
I was also dependent in phpmyadmin before until I know sqlyog and MySQL Query Browser and WorkBench. Have a look on this as an alternative on phpmyadmin.
Download MySQL Workbench
SQLyog free download
It's been a while since I've used phpMyAdmin, but if I'm not mistaken, it stores it's passwords in the mysql database it self. So, if you are able to get access to the command-line of the server, you are able to change the password using simple SQL statements.
Go to /etc/phpmyadmin folder.
Open config-db.php
Here you will find your default username and password