LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-29-2006, 05:24 PM   #1
samnjugu
Member
 
Registered: Apr 2006
Location: Atlanta
Distribution: Centos, knoppix, Fedora, Mepis, Zenwalk, Mint
Posts: 142

Rep: Reputation: 16
Exclamation ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)


am having trouble with mysql i just installed fedora 5.
am able to log in to mysql by typing the password:
mysql -p or mysql -u root -p.
but if i try to log in without a password :
# mysql or mysql -u root.
i get an error message ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
i have run the cmd mysql> set password for 'root'@'localhost' = password ('new-password');

but still the error persists am trying to intall phpmyadmin which gets the same error therefore i have put on hold installing any apps that require a database till i sort this out.

so i think m question is how do i enable mysql to let this cmd to work: mysql -u root.

any help will be gratly appreciated.

Last edited by samnjugu; 06-29-2006 at 05:26 PM.
 
Old 06-30-2006, 04:37 AM   #2
penguintutor
Member
 
Registered: Jun 2006
Location: UK
Distribution: Ubuntu, Mandriva, Redhat and Fedora
Posts: 118

Rep: Reputation: 15
You appear to be saying that you've set a password, and that mysql won't let you login without providing that password. That is how it is supposed to work.

If you are saying that you have set the password to a blank string, then this is not the same as turning off the password checking.

It's possible to set it up so that you don't need a password, but that is not advisable, particularly for the administrator.

If you need to run a command that needs the password on the commandline then you can use --password=<thepassword>
although this is less secure then entering it when prompted as the password will can be obtained by looking at the running processes. If you have set the password to be blank then use --password=""

phpmyadmin does not need to know the password, depending upon the authtype you choose. The default on my install is cookie, which means that you need to login using the username and password from the phpmyadmin login page.

It is really not a good idea to disable the password so I haven't given instructions on how to do it, but you can work it out from the mysql documentation.

Last edited by penguintutor; 06-30-2006 at 04:39 AM.
 
Old 07-08-2006, 08:35 PM   #3
samnjugu
Member
 
Registered: Apr 2006
Location: Atlanta
Distribution: Centos, knoppix, Fedora, Mepis, Zenwalk, Mint
Posts: 142

Original Poster
Rep: Reputation: 16
Lightbulb

problem solved specified connection method in config.default.php in phpmyadmin and worked like a charm thanks for your help though
 
Old 10-06-2008, 12:04 AM   #4
Ionutz
LQ Newbie
 
Registered: Oct 2008
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by samnjugu View Post
problem solved specified connection method in config.default.php in phpmyadmin and worked like a charm thanks for your help though
Can you be more specific? What should be changed in that config file?

CHeers
 
Old 10-07-2008, 06:47 AM   #5
samnjugu
Member
 
Registered: Apr 2006
Location: Atlanta
Distribution: Centos, knoppix, Fedora, Mepis, Zenwalk, Mint
Posts: 142

Original Poster
Rep: Reputation: 16
Hi,

Turned out i was doing the wrong thing as i was supposed to edit config.default.php and save as config.php in phpmyadmin root directory and my problems were solved. But I was leaving it in the original folder.

As for the exact fields to edit I will look for a link on configuring phpmyadmin and add it here, or you can try googling it and see if you get anything.
 
Old 10-08-2008, 02:57 PM   #6
samnjugu
Member
 
Registered: Apr 2006
Location: Atlanta
Distribution: Centos, knoppix, Fedora, Mepis, Zenwalk, Mint
Posts: 142

Original Poster
Rep: Reputation: 16
This are the main editing areas.

$cfg['blowfish_secret'] = 'UHDWDHWUUI54656547igjglkk5677H' ->change this value to any random characters you want to use. Note you only need this if you are going to use the cookie auth_type.

/* Servers configuration */




$cfg['Servers'][$i]['host'] = 'Localhost'
$cfg['Servers'][$i]['extension'] = 'mysqli'; -> or mysql wichever you want to use
$cfg['Servers'][$i]['port'] = 'your port'; ->leave blank for default
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['auth_type'] = 'cookie';

/* End of servers configuration */

Make sure your mysql is up and running first.
 
Old 07-22-2010, 06:13 AM   #7
aher.praju@yahoo.com
LQ Newbie
 
Registered: Jun 2010
Location: India
Posts: 2
Blog Entries: 4

Rep: Reputation: 0
Smile

Hi,

As Linux having its own security policies so when you try to go for Sql then keep in mind you must have proper authentication according to your configuration setting.

I do not think so here is problem other than proper authentication.

Thanks.
 
Old 11-20-2010, 05:11 AM   #8
shridarshan
LQ Newbie
 
Registered: Nov 2010
Posts: 3

Rep: Reputation: 1
Smile mysql issues

Hi Guys,


Issue:- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)


[root@servert1 ~]# /etc/init.d/mysqld stop

Stopping MySQL: [ OK ]

[root@servert1 ~]# mysqld_safe --skip-grant-tables &

[1] 13694

[root@servert1 ~]# Starting mysqld daemon with databases from /var/lib/mysql



[root@servert1 ~]# mysql -u root

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.0.77 Source distribution



Type 'help;' or '\h' for help. Type '\c' to clear the buffer.



mysql> update user set password=PASSWORD("testpass") where User='root';

ERROR 1046 (3D000): No database selected

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| information_schema |

| mysql |

| test |

+--------------------+

3 rows in set (0.13 sec)



mysql> use mysql;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A



Database changed

mysql> show tables;

+---------------------------+

| Tables_in_mysql |

+---------------------------+

| columns_priv |

| db |

| func |

| help_category |

| help_keyword |

| help_relation |

| help_topic |

| host |

| proc |

| procs_priv |

| tables_priv |

| time_zone |

| time_zone_leap_second |

| time_zone_name |

| time_zone_transition |

| time_zone_transition_type |

| user |

+---------------------------+

17 rows in set (0.00 sec)



mysql> update user set password=PASSWORD("testpass") where User='root';

Query OK, 3 rows affected (0.05 sec)

Rows matched: 3 Changed: 3 Warnings: 0



mysql> flush privileges;

Query OK, 0 rows affected (0.04 sec)



mysql> quit

Bye

[root@servert1 ~]# /etc/init.d/mysql restart

bash: /etc/init.d/mysql: No such file or directory

[root@servert1 ~]# /etc/init.d/mysqld restart

STOPPING server from pid file /var/run/mysqld/mysqld.pid

101120 04:17:15 mysqld ended



Stopping MySQL: [ OK ]

Starting MySQL: [ OK ]

[1]+ Done mysqld_safe --skip-grant-tables

[root@servert1 ~]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.0.77 Source distribution



Type 'help;' or '\h' for help. Type '\c' to clear the buffer.



mysql> quit

Bye

[root@servert1 ~]#
 
1 members found this post helpful.
Old 11-20-2010, 05:16 AM   #9
shridarshan
LQ Newbie
 
Registered: Nov 2010
Posts: 3

Rep: Reputation: 1
Cool Err

Hi Guys,
Try this..............


Issue:- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)


[root@servert1 ~]# /etc/init.d/mysqld stop

Stopping MySQL: [ OK ]

[root@servert1 ~]# mysqld_safe --skip-grant-tables &

[1] 13694

[root@servert1 ~]# Starting mysqld daemon with databases from /var/lib/mysql



[root@servert1 ~]# mysql -u root

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.0.77 Source distribution



Type 'help;' or '\h' for help. Type '\c' to clear the buffer.



mysql> update user set password=PASSWORD("testpass") where User='root';

ERROR 1046 (3D000): No database selected

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| information_schema |

| mysql |

| test |

+--------------------+

3 rows in set (0.13 sec)



mysql> use mysql;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A



Database changed

mysql> show tables;

+---------------------------+

| Tables_in_mysql |

+---------------------------+

| columns_priv |

| db |

| func |

| help_category |

| help_keyword |

| help_relation |

| help_topic |

| host |

| proc |

| procs_priv |

| tables_priv |

| time_zone |

| time_zone_leap_second |

| time_zone_name |

| time_zone_transition |

| time_zone_transition_type |

| user |

+---------------------------+

17 rows in set (0.00 sec)



mysql> update user set password=PASSWORD("testpass") where User='root';

Query OK, 3 rows affected (0.05 sec)

Rows matched: 3 Changed: 3 Warnings: 0



mysql> flush privileges;

Query OK, 0 rows affected (0.04 sec)



mysql> quit

Bye

[root@servert1 ~]# /etc/init.d/mysql restart

bash: /etc/init.d/mysql: No such file or directory

[root@servert1 ~]# /etc/init.d/mysqld restart

STOPPING server from pid file /var/run/mysqld/mysqld.pid

101120 04:17:15 mysqld ended



Stopping MySQL: [ OK ]

Starting MySQL: [ OK ]

[1]+ Done mysqld_safe --skip-grant-tables

[root@servert1 ~]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.0.77 Source distribution



Type 'help;' or '\h' for help. Type '\c' to clear the buffer.



mysql> quit

Bye

[root@servert1 ~]#[/QUOTE]
 
Old 02-15-2011, 12:32 AM   #10
rahul.monap
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Rep: Reputation: 0
when i give this commond its stuk on it not showing any result
Starting mysqld daemon with databases from /var/lib/mysql
 
Old 04-16-2012, 08:13 AM   #11
Rarez
LQ Newbie
 
Registered: Apr 2012
Posts: 1

Rep: Reputation: Disabled
Friggin' finally! I wish I had read this post 7 hours ago.... I don't even know what caused the error.. All I was doing was cleaning up databases & tables... guess I deleted the wrong one >.>....

Thank you, sir!

Sorry for the gravedig... but I had to thank this guy.

Quote:
Originally Posted by shridarshan View Post
Hi Guys,


Issue:- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)


[root@servert1 ~]# /etc/init.d/mysqld stop

Stopping MySQL: [ OK ]

[root@servert1 ~]# mysqld_safe --skip-grant-tables &

[1] 13694

[root@servert1 ~]# Starting mysqld daemon with databases from /var/lib/mysql



[root@servert1 ~]# mysql -u root

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.0.77 Source distribution



Type 'help;' or '\h' for help. Type '\c' to clear the buffer.



mysql> update user set password=PASSWORD("testpass") where User='root';

ERROR 1046 (3D000): No database selected

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| information_schema |

| mysql |

| test |

+--------------------+

3 rows in set (0.13 sec)



mysql> use mysql;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A



Database changed

mysql> show tables;

+---------------------------+

| Tables_in_mysql |

+---------------------------+

| columns_priv |

| db |

| func |

| help_category |

| help_keyword |

| help_relation |

| help_topic |

| host |

| proc |

| procs_priv |

| tables_priv |

| time_zone |

| time_zone_leap_second |

| time_zone_name |

| time_zone_transition |

| time_zone_transition_type |

| user |

+---------------------------+

17 rows in set (0.00 sec)



mysql> update user set password=PASSWORD("testpass") where User='root';

Query OK, 3 rows affected (0.05 sec)

Rows matched: 3 Changed: 3 Warnings: 0



mysql> flush privileges;

Query OK, 0 rows affected (0.04 sec)



mysql> quit

Bye

[root@servert1 ~]# /etc/init.d/mysql restart

bash: /etc/init.d/mysql: No such file or directory

[root@servert1 ~]# /etc/init.d/mysqld restart

STOPPING server from pid file /var/run/mysqld/mysqld.pid

101120 04:17:15 mysqld ended



Stopping MySQL: [ OK ]

Starting MySQL: [ OK ]

[1]+ Done mysqld_safe --skip-grant-tables

[root@servert1 ~]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.0.77 Source distribution



Type 'help;' or '\h' for help. Type '\c' to clear the buffer.



mysql> quit

Bye

[root@servert1 ~]#

Last edited by Rarez; 04-16-2012 at 08:25 AM.
 
Old 10-22-2012, 09:36 AM   #12
shaik_rafi2009
LQ Newbie
 
Registered: Nov 2009
Posts: 11

Rep: Reputation: 0
Excellent shridarshan, You saved my time.

Last edited by shaik_rafi2009; 10-23-2012 at 07:11 AM. Reason: better comment
 
Old 01-22-2013, 06:22 AM   #13
subramaniyam
LQ Newbie
 
Registered: Jan 2013
Posts: 1

Rep: Reputation: Disabled
Smile Excellent Mr shridarshan

Thank You Very Much, Thank You for your Very Nice Step by Step Assistance.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MYSQL: Access denied for user 'root'@'localhost' (using password: NO) jun_tuko Linux - Software 3 03-05-2013 06:37 AM
Sarge mysql-server Access denied for user: root@localhost infinity432 Linux - Software 2 05-18-2005 11:42 PM
Directory access denied to root user: inode hack? netmar Linux - Security 2 07-31-2004 04:53 AM
mysql root access err 1045... beware of this latino Linux - Newbie 0 03-15-2004 09:07 PM
why I got "Access denied for user: 'root@localhost'" likedreamer Red Hat 1 11-09-2003 05:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration