473,387 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ERROR 1045 (28000) Access denied for user 'root'@'localhost'. Symfony. Bitnami WAMP

103 100+
I sit already 2h browsing internet and i am not able to find a solution. Could you please help me.

Bitnami WAMP, Symfony

1) I am not able to login to MYSQL through console
using command: mysql -u root -p
using command: mysql -h localhost -u root -p
using command: mysql -h localhost -u root -p -P 3006
using command: mysql -h 127.0.0.1 -u root -p
using command: mysql -h 127.0.0.1 -u root -p -P 3006
i am getting the same error in all cases: ERROR 1045 (28000) Access denied for user 'root'@'localhost' (using password: NO)

2) I am not able to login to PhpMyAdmin, using user "root" and empty field for password.

3) I am not able to generate entity from console in Symfony application. I am getting error:[PDOException] SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (password: NO)


config.inc.php
in folder
C:\Bitnami\wampstack-5.4.36-0\apps\phpmyadmin\htdocs\config.inc.php
contains the following lines:
Expand|Select|Wrap|Line Numbers
  1. $cfg['Servers'][$i]['host'] = 'localhost';
  2. $cfg['Servers'][$i]['user'] = 'root';
  3. $cfg['Servers'][$i]['password'] = '';
  4. $cfg['Servers'][$i]['port'] = '3306'; 
I also tried 127.0.0.1 instead of localhost.

parameters.yml
in folder
C:\Bitnami\wampstack-5.4.36-0\sym_prog\myproject\app\config
contains the following lines:
Expand|Select|Wrap|Line Numbers
  1. parameters:
  2.     database_driver: pdo_mysql
  3.     database_host: 127.0.0.1
  4.     database_port: null
  5.     database_name: symfony
  6.     database_user: root
  7.     database_password: null
  8.     mailer_transport: smtp
  9.     mailer_host: 127.0.0.1
  10.     mailer_user: null
  11.     mailer_password: null
  12.     locale: en
  13.     secret: 50cbd9b37723fsdfgd9202880589f27baa6df5b3dd
i also tried "localhost" instead of 127.0.0.1.

How to make user 'root'@'localhost' to be accepted?
Mar 6 '15 #1
10 6493
gintare
103 100+
When i try to use command mysql in console, i am geting error that 'ODBC'@'localhost' can not connect.


c:\Bitnami\wampstack-5.4.36-0>mysql
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)
Mar 7 '15 #2
Luuk
1,047 Expert 1GB
I think your root password is not matching with what you provide during your attempts...

Try resetting the password for 'root'

see: http://dev.mysql.com/doc/refman/5.0/...rmissions.html
Mar 7 '15 #3
gintare
103 100+
C:\Bitnami\wampstack-5.4.36-0\apps\phpmyadmin\htdocs\config.inc.php

$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['nopassword'] = true;
$cfg['Servers'][$i]['AllowNoPassword'] = true;

It means that i do not need password to login.
Mar 7 '15 #4
Luuk
1,047 Expert 1GB
No, it meand that phpmyadmin is configured not to as for as password.......

But how it MySQL configured????
Mar 7 '15 #5
gintare
103 100+
I use command: mysql --help --verbose
It output the following directories and filenames:
Expand|Select|Wrap|Line Numbers
  1. Default options are read from the following files in the given order:
  2. C:\Windows\my.ini 
  3. C:\Windows\my.cnf 
  4. C:\my.ini 
  5. C:\my.cnf 
  6. c:\bitnami\wampstack-5.4.36-0\mysql\my.ini 
  7. c:\bitnami\wampstack-5.4.36-0\mysql\my.cnf
I could not find:
C:\my.ini
C:\my.cnf
C:\Windows\my.ini
C:\Windows\my.cnf
c:\bitnami\wampstack-5.4.36-0\mysql\my.cnf
I found only
c:\bitnami\wampstack-5.4.36-0\mysql\my.ini
which does not contain password option. The contents without most of comments:
Expand|Select|Wrap|Line Numbers
  1. [mysqldump]
  2. max_allowed_packet=16M
  3.  
  4. [isamchk]
  5. key_buffer_size=20M
  6. sort_buffer_size=20M
  7. read_buffer=2M
  8. write_buffer=2M
  9.  
  10. [myisamchk]
  11. key_buffer_size=20M
  12. sort_buffer_size=20M
  13. read_buffer=2M
  14. write_buffer=2M
  15.  
  16. [mysqlhotcopy]
  17.  
  18. [mysqladmin]
  19. user=root
  20. port=3306
  21. # set basedir to your installation path
  22. basedir=C:/Bitnami/WAMPST~1.36-/mysql
  23. # set datadir to the location of your data directory
  24. datadir=C:/Bitnami/WAMPST~1.36-/mysql\data
  25. port=3306
  26. #skip-locking
  27. key_buffer_size=16M
  28. max_allowed_packet=16M
  29. table_cache=64
  30. sort_buffer_size=512K
  31. net_buffer_length=8K
  32. read_buffer_size=256K
  33. read_rnd_buffer_size=512K
  34. myisam_sort_buffer_size=8M
  35. bind-address=127.0.0.1
  36.  
  37.  
Finally i have added line to
c:\bitnami\wampstack-5.4.36-0\mysql\my.ini
I have tried several combinations, restarting MySQL server each time i make change:
password="some"
password='some'
password=some
password=none
password=""
password=''

I check if this works by command
mysql -u root -p
But i am still getting error "ERROR 1045 (28000): Access denied for user 'root'@'localhost'".

I also tried command:
mysql -u root -p "some"
(with "", '' and without quotes), but it outputs help.
According
http://www.cyberciti.biz/faq/mysql-c...root-password/
This command works only for the first time. If password already exists somewhere, this command is not working.

According,
http://www.cyberciti.biz/tips/recove...-password.html
Expand|Select|Wrap|Line Numbers
  1. (1) Stop the server: /etc/init.d/mysql stop 
  2. (2) Start the mysql daemon: # mysqld_safe –skip-grant-tables
  3. (3)* While its running, open another terminal and login to mysql
  4. # mysql -u root (hit enter)
  5. (4) Now you are logged in.
  6. mysql>use mysql;
  7. mysql>update user set password=PASSWORD(“YOUR_NEW_PASS”) where User=’root';
  8. you should see the output: Query ok etc.
  9. mysql>flush privileges;
  10. mysql>quit
  11. (5) stop the server: /etc/init.d/mysql stop
  12. (6) *Confirm that no mysql processes are still running (in my case they were and made the server fail to start). To check this: run this
  13. ps ax | grep mysql
  14. Now kill the process IDs of any mysql still running in the background using kill PID
  15. e.g. kill 4425. Do not use kill -9 as this may crash the database entirely!!
  16. Confirm no mysql process is still running: ps ax | grep mysql
  17. (7) Then start the server: /etc/init.d/mysql start
  18. (8) login with your new password: mysql -u root -p
But in my case, seems mysqld is not working.
I have found
C:\Bitnami\wampstack-5.4.36-0\mysql\bin\mysqld.exe
Using command: mysqld --verbose --help
outputs range of commands "–skip-grant-tables" including, but there is a notice FALSE on the same line.
I stop mysql server from WINAMP options window, than i run: mysqld –skip-grant-tables
than i open another termnal and try to login using: mysql -u root
I am getting "ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)"


How to configure(set) password for root in mysql?
Should i create *.cnf file?

Actually the main problem is that i can not create tables in Symfony. Most probably symfony use "C:\Bitnami\wampstack-5.4.36-0\sym_prog\myproject\app\config\parameters.yml" parameters and overwrites mysql settings? But it can not overwrite because it tries to overwrite the wrong file, which does not exists?
Mar 8 '15 #6
Luuk
1,047 Expert 1GB
Because you configured phpmyadmin to NOT use a password for root,
You should make sure you can use MySQL with :
C:\> MySQL -u root

If above is failing, than try, (and specify the correct paasword):
C:\> MySQL -u root -p
If you need this last line, than your setup of MySQL is not in line with the setup of phpmyadmin.
Mar 8 '15 #7
gintare
103 100+
I do not agree that settings:
$cfg['Servers'][$i]['nopassword'] = true;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
affects how root logins.

The question is how to reset root password if it is forgotten or how to retrieve it?

Finally, i have reinstalled Bitnami WAMP, i was asked to create root password on the first step and now everything works using this password.

But if somebody could tell how to reset MYSQL root password or how to retrieve it if i forget, could you please write.

mysql Ver 14.14 Distrib 5.5.42, for Win32 (x86)
installed with Bitnami WAMP stack 5.4.38-0
Mar 8 '15 #8
gintare
103 100+
All discussion above complains about several different things: that i can not login to mysql from command line as root, that i can not login to PhPMyAdming, that i can not generate tables with Symfony.

Summarizing, the question is "how to reset MYSQL root password or how to retrieve it if i forget"?

mysql Ver 14.14 Distrib 5.5.42, for Win32 (x86)
installed with Bitnami WAMP stack 5.4.38-0
Mar 8 '15 #9
Luuk
1,047 Expert 1GB
"Summarizing, the question is "how to reset MYSQL root password or how to retrieve it if i forget"?"

see my first reply, the link is:
http://dev.mysql.com/doc/refman/5.0/...rmissions.html
Mar 8 '15 #10
gintare
103 100+
THANKS, NOW IT WORKS!!!
I did not read your first reply carefully, i am sorry!

Just several notices.
After BITNAMI WAMP INSTALLATION
1) MySQL server is not running as a service ( "From the Start menu, select Control Panel, then Administrative Tools, then Services").
2) MySQL service is not listen in Task Manager Services (Ctl+Al+Del on Windows)
3) It is possible to stop the service only though WAMPStack Manager Tool.
4) Trying the given command "mysqld-nt" outputs error: "c:\>mysqld-nt --init-file=C:\\mysql-init.txt
'mysqld-nt' is not recognized as an internal or external command, operable program or batch file."

5)Trying the modified command "mysqld -nt" outputs warning but works, i.e changes root password: "c:\>mysqld -nt --init-file=C:\\mysql-init.txt
150308 15:05:44 [Warning] option 'new': boolean value 't' wasn't recognized. Set to OFF."""
Mar 8 '15 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Steve | last post by:
Hi, Yesterday I signed up for another dedicated linux server with the hosting company I use and I am having problems getting MySQL 4.1.3 working on it. I've tried just about everything I can...
2
by: Frank Natoli | last post by:
Decided to update my desktop with latest MySQL Server 4.1.10a and connector 3.1.6. Un-installed MySQL Server 4.0.21. Now mysql.exe is refusing to start with error: ERROR 1045 (28000): Access...
0
by: matsla | last post by:
I have followed all guide lines to set up remote debugging but is it possible to do cross-domain remote debugging? I use same account/password on both computers (XP => 2003), added users to debug...
2
by: SKB | last post by:
Hi, I am absolutely new to this area. I am getting the following difficulty : Access denied for user 'ODBC'@'localhost' (using password: NO) when I try the mysql command from within the...
2
by: Ray Muforosky | last post by:
Hello everyone. I created a new user with the grant command and yet, I can't login into the database I must mention that the user was created but all the privileges are set to 'N'. This is...
7
by: rajbala.3399 | last post by:
Hi , I want to download sql in my linux system........... # rpm -ivh MySQL-server-5.0.24a-0.glibc23.i386.rpm MySQL-cl ient-5.0.24a-0.glibc23.i386.rpm Preparing... ...
1
usafshah
by: usafshah | last post by:
Hi I'm using linux with mysql , when i type mysql in terminal it says like: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) i'm logged in as root but...
5
by: stmfc | last post by:
i am trying to use mysql db for the first time. i have installed mysql-noinstall-5.0.45-win32.zip to my pc. although i didnt have set any password, when i try to login for mysqladmin user via...
1
by: ajd335 | last post by:
Hi all... I am working with PHP and mysql. I have one form from which i am importing data into the table. Now i want "email " field result into a text file I am using code select email...
1
by: ajd335 | last post by:
Hi all... I am working with PHP and mysql. I have one form from which i am importing data into the table. Now i want "email " field result into a text file I am using code select email...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.