Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I run

mysqladmin5 -u root -p ping

I get a password request.

I found the following instructions but they seem to be rather brutal

<<
After installing MySQL 5 on Solaris with pkgadd you will have to perform
the following post-installation tasks:
As root:
# rm -rf /var/lib/mysql/mysql
Then as mysql:
$ cd /opt/mysql/mysql
$ scripts/mysql_install_db
Then as root:
# /etc/init.d/mysql start
Then as mysql:
$ /opt/mysql/mysql/bin/mysqladmin -u root password 'password'
Then as root:
# /opt/mysql/mysql/bin/mysql_secure_installation
>>

The password was not blank as in some versions of MySQL.

Thank you for pointing that out! The version of my MySQL seems to be

mysql5 --version     
mysql5  Ver 14.12 Distrib 5.0.83, for apple-darwin9.7.0 (i386) using readline 6.0

What is the default password of the MySQL?

share|improve this question
1  
mysqladmin is at version 8.41, not MySQL. –  Joseph Jul 4 '09 at 13:47
    
Thank you for your answers! –  Masi Jul 4 '09 at 14:12
add comment

3 Answers

up vote 6 down vote accepted

Remove the -p. That is making it prompt you for a password.

http://linux.die.net/man/1/mysqladmin

share|improve this answer
add comment

The default password depends on the distribution, I think. In some Linux distributions you're asked to enter pass during installation, in other it's blank for connection over loopback.

Try starting MySQL with the --skip-grant-tables option, then logon with the MySQL command line and change root's password.

share|improve this answer
    
Thank you for pointing that out! --- I fixed my mistake. –  Masi Jul 4 '09 at 13:49
    
I guess he is using mysqladmin 8.41 on MySQL5. –  nik Jul 4 '09 at 13:58
add comment
mysql -p ping

is very different from

mysql --password=ping

first one means "Connect to database and prompt for password", second one means, "Connect to database with password 'ping'"

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.