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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-29-2006, 05:24 PM
|
#1
|
Member
Registered: Apr 2006
Location: Atlanta
Distribution: Centos, knoppix, Fedora, Mepis, Zenwalk, Mint
Posts: 142
Rep:
|
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.
|
|
|
06-30-2006, 04:37 AM
|
#2
|
Member
Registered: Jun 2006
Location: UK
Distribution: Ubuntu, Mandriva, Redhat and Fedora
Posts: 118
Rep:
|
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.
|
|
|
07-08-2006, 08:35 PM
|
#3
|
Member
Registered: Apr 2006
Location: Atlanta
Distribution: Centos, knoppix, Fedora, Mepis, Zenwalk, Mint
Posts: 142
Original Poster
Rep:
|
problem solved specified connection method in config.default.php in phpmyadmin and worked like a charm thanks for your help though
|
|
|
10-06-2008, 12:04 AM
|
#4
|
LQ Newbie
Registered: Oct 2008
Posts: 1
Rep:
|
Quote:
Originally Posted by samnjugu
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
|
|
|
10-07-2008, 06:47 AM
|
#5
|
Member
Registered: Apr 2006
Location: Atlanta
Distribution: Centos, knoppix, Fedora, Mepis, Zenwalk, Mint
Posts: 142
Original Poster
Rep:
|
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.
|
|
|
10-08-2008, 02:57 PM
|
#6
|
Member
Registered: Apr 2006
Location: Atlanta
Distribution: Centos, knoppix, Fedora, Mepis, Zenwalk, Mint
Posts: 142
Original Poster
Rep:
|
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.
|
|
|
07-22-2010, 06:13 AM
|
#7
|
LQ Newbie
Registered: Jun 2010
Location: India
Posts: 2
Rep:
|
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.
|
|
|
11-20-2010, 05:11 AM
|
#8
|
LQ Newbie
Registered: Nov 2010
Posts: 3
Rep:
|
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.
|
11-20-2010, 05:16 AM
|
#9
|
LQ Newbie
Registered: Nov 2010
Posts: 3
Rep:
|
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]
|
|
|
02-15-2011, 12:32 AM
|
#10
|
LQ Newbie
Registered: Nov 2010
Posts: 2
Rep:
|
when i give this commond its stuk on it not showing any result
Starting mysqld daemon with databases from /var/lib/mysql
|
|
|
04-16-2012, 08:13 AM
|
#11
|
LQ Newbie
Registered: Apr 2012
Posts: 1
Rep: 
|
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
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.
|
|
|
10-22-2012, 09:36 AM
|
#12
|
LQ Newbie
Registered: Nov 2009
Posts: 11
Rep:
|
Excellent shridarshan, You saved my time.
Last edited by shaik_rafi2009; 10-23-2012 at 07:11 AM.
Reason: better comment
|
|
|
01-22-2013, 06:22 AM
|
#13
|
LQ Newbie
Registered: Jan 2013
Posts: 1
Rep: 
|
Excellent Mr shridarshan
Thank You Very Much, Thank You for your Very Nice Step by Step Assistance.
|
|
|
All times are GMT -5. The time now is 02:51 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|