New Installation but MySQL is unknown? Print

  • 0

Error

MySQL version is Unknown.

Reason

Temporarily, the mysql rpm was unavailable in our repository. If a new install happened during this time, it was skipped and installed later. The password was then unable to be properly hashed as that happens during initial installation.

Fix

First make sure mysql is install with rpm -qa | grep mysql. Then:

[root@multi ~]# grep rootdsn ~iworx/iworx.ini
rootdsn="mysql://iworx:<password shows here>@unix(/var/lib/mysql/mysql.sock)/mysql"
[root@multi ~]# ~iworx/bin/mysql/mysql -u iworx -S /var/lib/mysql/mysql.sock -p
Enter password: <try password here>
ERROR 1045: Access denied for user 'iworx'@'localhost' (using password: YES)

If you get the 1045 error then we know this is the problem.

Add skip-grant-tables & old_passwords=1 to /etc/my.cnf and restart mysqld: service mysqld restart

[root@multi ~]# ~iworx/bin/mysql/mysql -u iworx -S /var/lib/mysql/mysql.sock -p
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.5.41

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

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> update user set password=password('<paste password from above here>') where user='iworx';
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0

If 0 rows are changed then either the password was properly set or something else went wrong. 

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit

Remove skip-grant-tables from /etc/my.cnf and restart mysqld: service mysqld restart and you should be good to go.


Was this answer helpful?

« Back