LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-11-2010, 09:34 PM   #1
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Rep: Reputation: 40
mysqladmin fails on new install


Hi group,

I have two new Fedora 12 installs and both fail to complete the install and configuration of MySQL.
When I run mysql_install_db I get:
mysql_install_db --verbose
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h server.domain_name password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

Then I run
mysqladmin --verbose -u root password
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
The SQL server is running:
netstat -al | grep sql
tcp 0 0 *:mysql *:* LISTEN
unix 2 [ ACC ] STREAM LISTENING 714238 /var/lib/mysql/mysql.sock
I have found many posting about getting MySQL working but none have these condition.

Any ideas??

Thanks for your time.
 
Old 05-11-2010, 11:21 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Q: have you tried this:
Quote:
mysql -uroot -pYOUR_PASSWORD mysql
select User,Host from user;
quit;
If it fails, please cut/paste the exact error message (everything except the actual password)
 
Old 05-11-2010, 11:57 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
have you configured SELinux to allow mysqlmyadmin

Quote:
both fail to complete the install and configuration
how are you installing the programs . with yum ? or building from source, or installing a prebuilt bin.

as i recall fedora likes apache and mysql to be ran as daemons
 
Old 05-12-2010, 01:18 AM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
John VV -

I suspect maybe the OP made a syntax error when he created the password.

I believe the easiest way to proceed is to see if he can get in with "mysql" (either with or without a password) and see if he can list the mysql users.

Further: he if can't, then the specific error message (which I asked him to cut/paste) should be instructive.

IMHO .. PSM

PS:
I just spent the last two hours debugging what (I thought!) was a simple MySql permissions problem myself
 
Old 05-12-2010, 03:36 AM   #5
Blue_Ice
Member
 
Registered: Jul 2006
Location: Belgium
Distribution: Debian, Fedora, CentOS, Windows
Posts: 361

Rep: Reputation: Disabled
First of all, you cannot use your password with the mysql command.
It should be something like this:
Code:
mysql -h <host> -u <user> -p
After executing this command you will be prompted for your password. If you do try to add your password to the command, then it will think it is the database name and fail.

I was also wondering if you installed MySQL from source or from a repository? Probably from source, but just to be sure...
 
Old 05-12-2010, 09:33 AM   #6
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Blue_ice:

The syntax ("mysql -uSOME_USER -pUSER_PASSWORD SOME_DATABASE") is perfectly acceptable. Try it

Again - I'm hoping the OP will try this (or an equivalent command, like yours) and post back the results. So we can help him resolve the problem
 
Old 05-12-2010, 11:38 AM   #7
Blue_Ice
Member
 
Registered: Jul 2006
Location: Belgium
Distribution: Debian, Fedora, CentOS, Windows
Posts: 361

Rep: Reputation: Disabled
That's why I said that... I have tried it on my server and it failed miserably.

Tried it again and you are right it works, but only when there is no space between -p and the password.
Anyway, the way the OP tries to connect will certainly not work.
 
Old 05-13-2010, 12:49 PM   #8
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Original Poster
Rep: Reputation: 40
it was in the first post

Quote:
Originally Posted by paulsm4 View Post
Q: have you tried this:


If it fails, please cut/paste the exact error message (everything except the actual password)
Quote:
Then I run

mysqladmin --verbose -u root password
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
also
Quote:
mysql --verbose -u root password
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Maybe it has to do with the 'localhost' ?? In the netstat I see
Quote:
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
That should be right, right?? '0.0.0.0' is any port?

Also, I installed using yum, nothing special, just standard rpm stuff.
 
Old 05-13-2010, 12:59 PM   #9
Blue_Ice
Member
 
Registered: Jul 2006
Location: Belgium
Distribution: Debian, Fedora, CentOS, Windows
Posts: 361

Rep: Reputation: Disabled
Try the following command:
Code:
mysql --verbose -u root -p
After this you will be prompted for the password.
You probably don't want to use mysqladmin anymore. The 'mysql' command is used to maintain databases.
 
Old 05-14-2010, 11:27 AM   #10
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Original Poster
Rep: Reputation: 40
Yes, I have with the same results

Quote:
Originally Posted by Blue_Ice View Post
Try the following command:
Code:
mysql --verbose -u root -p
After this you will be prompted for the password.
You probably don't want to use mysqladmin anymore. The 'mysql' command is used to maintain databases.
The root password has been not been set yet, so it fails:
Code:
mysql --verbose -u root -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


[root@hplaptop ~]# /usr/bin/mysqladmin -u root password newpassword
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
[root@hplaptop ~]# usr/bin/mysqladmin -h 0.0.0.0 -u root password newpassword
-bash: usr/bin/mysqladmin: No such file or directory
[root@hplaptop ~]# /usr/bin/mysqladmin -h 127.0.0.1 -u root password newpassword
/usr/bin/mysqladmin: connect to server at '127.0.0.1' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
 
Old 05-14-2010, 12:23 PM   #11
Blue_Ice
Member
 
Registered: Jul 2006
Location: Belgium
Distribution: Debian, Fedora, CentOS, Windows
Posts: 361

Rep: Reputation: Disabled
1) Login to the MySQL server, type the following command at the shell prompt of localhost:
Code:
$ mysql -u root
2) Use the mysql database (type commands at the mysql> prompt):
Code:
mysql> use mysql;
3) Change password for a user:
Code:
mysql> update user set password=PASSWORD("newpass") where User='root';
4) Reload privileges:
Code:
mysql> flush privileges;
mysql> quit

Last edited by Blue_Ice; 05-14-2010 at 12:25 PM.
 
Old 05-15-2010, 01:22 PM   #12
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Original Poster
Rep: Reputation: 40
That does not work!

Quote:
Originally Posted by Blue_Ice View Post
1) Login to the MySQL server, type the following command at the shell prompt of localhost:
Code:
$ mysql -u root
2) Use the mysql database (type commands at the mysql> prompt):
Code:
mysql> use mysql;
3) Change password for a user:
Code:
mysql> update user set password=PASSWORD("newpass") where User='root';
4) Reload privileges:
Code:
mysql> flush privileges;
mysql> quit


[root@hplaptop ~]# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@hplaptop ~]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@hplaptop ~]# cat /var/log/mysqld.log
100515 11:18:15 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
100515 11:18:15 [Note] Plugin 'ndbcluster' is disabled.
100515 11:18:15 InnoDB: Started; log sequence number 0 44233
100515 11:18:15 [Note] Event Scheduler: Loaded 0 events
100515 11:18:15 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.45' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
[root@hplaptop ~]# ps axw | grep mysql
3049 pts/1 S 0:00 /bin/sh /usr/bin/mysqld_safe --verbose --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql
3144 pts/1 Sl 0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --verbose --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
3241 pts/0 S+ 0:00 grep mysql
You have mail in /var/spool/mail/root
[root@hplaptop ~]#


 
Old 05-15-2010, 01:46 PM   #13
Blue_Ice
Member
 
Registered: Jul 2006
Location: Belgium
Distribution: Debian, Fedora, CentOS, Windows
Posts: 361

Rep: Reputation: Disabled
Are you sure you didn't set a password for root yet?
 
Old 05-15-2010, 11:07 PM   #14
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Q: have you tried this:
Quote:
mysql -uroot -pYOUR_PASSWORD mysql
select User,Host from user;
quit;
A: It was in the first post

RESPONSE: Uh - no. I didn't see "mysql" anywhere before your most recent post.
Quote:
Q: Are you sure you didn't set a password for root yet?

RESPONSE: Excellent question. ARE you sure you didn't set the password for "root" yet???
OK: this isn't rocket science. Please do this:
Quote:
1. Try "mysql" with the "root" password you *might* have entered.
Use "mysql" (accept no substitutes ).
Do *not* put spaces between the "-u" and "-p" parameters.
Type EXACTLY like this (substituting your actual password):
Quote:
mysql -uroot -pPASSWORD mysql
2. If it succeeds, you're home free.

3. If it fails (with the same permission error), reset the "root" password with these instructions:
http://dev.mysql.com/doc/refman/5.0/...rmissions.html

4. Please post back what you find.
Thanx in advance!
 
Old 05-16-2010, 12:02 PM   #15
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA, Earth
Distribution: Debian/ Fedora/ Ubuntu/ Raspbian
Posts: 549

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by paulsm4 View Post

OK: this isn't rocket science. Please do this:
Quote:
1. Try "mysql" with the "root" password you *might* have entered.
Use "mysql" (accept no substitutes ).
Do *not* put spaces between the "-u" and "-p" parameters.
Type EXACTLY like this (substituting your actual password):
Quote:
mysql -uroot -pPASSWORD mysql
2. If it succeeds, you're home free.

3. If it fails (with the same permission error), reset the "root" password with these instructions:
http://dev.mysql.com/doc/refman/5.0/...rmissions.html

4. Please post back what you find.
Thanx in advance!
Thanks for all of your patiences. It is really frustrating trying to help others.

Yes, I am sure I have no set the password. The mysql_install_db should reset it anyway, right? Which file is it keep in?

Here is what you requested:
Code:
[root@hplaptop ~]# /etc/init.d/mysqld start
Starting MySQL:                                            [  OK  ]
[root@hplaptop ~]# mysql -uroot -pPASSWORD mysql 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@hplaptop ~]#
I think it is a very simple problem, like the port and/or hostname I am using?? But I don't see it. The does not show anything special.
Code:
100516 09:43:01 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
100516 09:43:09 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
100516  9:43:09 [Note] Plugin 'ndbcluster' is disabled.
100516  9:43:09  InnoDB: Started; log sequence number 0 44233
100516  9:43:09 [Note] Event Scheduler: Loaded 0 events
100516  9:43:09 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.45'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
It must be something I am doing wrong since it fails the same way on four system? I have even removed MySQL and reinstalled it.
 
  


Reply



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
MySQLadmin is missing from RH ES3.0 bentman78 Linux - Software 9 11-30-2009 02:20 PM
mysqladmin doesn't work properly Dark Severance Red Hat 0 04-21-2005 09:55 AM
mysqladmin file is missing? dtournas Linux - Software 1 01-16-2005 01:15 PM
mysqladmin problem hrishikesh Linux - Software 1 07-08-2003 12:55 PM
mysqladmin vcheah Linux - Software 2 11-24-2002 03:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:24 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