Azazia Software Knowledgebase
Search:     Advanced search
Browse by category:
Contact Us

How to Change a mysql userid password if the password is blank ( an empty space or carriage return)

Add comment
Views: 520
Votes: 0
Comments: 0
Posted: 07 Oct, 2009
by: Patridge B.
Updated: 07 Oct, 2009
by: Patridge B.
When using a generic install of Mysql, OR when using WAMP which installs Mysql, the default password is EMPTY (meaning you just press enter).

Therefore after you install mysql, to get to the command prompt you would type:

# mysql -uroot -p
enter password: <enter>
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
+--------------------+


Above where it says enter password you would press ENTER to get ot the mysql prompt.


To get around this, the answer is actually simpler than even I thought.

# mysql -uroot <enter>
mysql> show databases
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
+--------------------+


Now that you verified this works you can change the password:

# mysqladmin -uroot password mynewpassword
#
#mysql -u root -p mynewpassword -e"show databases"
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
+--------------------+
#
Others in this Category
document Obtaining the maximum value in a numerical list of data in a mysql table
document Using an alternate MySQL user account other than the MySQL root user with Data Center Audit (DCA)
document I have run the installer however it says it will not connect to the database (unable to connect to database).
document How do I manually create the DCA MySQL Database and Tables on Windows?
document How to verify I have the mysql password set prior to installation on a Windows Machine
document mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in



RSS