Mysql problem on install


(papukaija) #1

Hello

I tried to install piwik to my website, but on the “databaseSetup”-step I got the following error message:

Error while trying to connect to the MySQL database:
No entry is registered for key 'db'

The mysql details are correct because my other php/mysql scripts are working normally. What should I do?


(vipsoft) #2

It means Piwik couldn’t read the db configuration.

Look in your config folder. Check the file permissions. Is piwik able to create a config.ini.php file?


(nattfodd) #3

I am experiencing the exact same problem. piwik can write/read in config (I chmoded all of it in 777 just to be sure).

Any ideas on what could be wrong here?


(vipsoft) #4

Check your mysql configuration, eg localhost vs 127.0.0.1, non-standard port, etc.


(nattfodd) #5

I checked, nothing is unusual. I have several other web frameworks (e.g. pixelpost or dotclear) sharing the same DB with exactly the same information, and they never had any trouble.


(Calidonia Hibernia) #6

I obtain the same message using same MySQL user/database creation process I followed for WordPress installations (user with all privileges, chmod 777 on tmp and config folders)

Impossible for me to reach step 4 of installation.


(vipsoft) #7

PM the database section of your config.ini.php.


(akonze) #8

I have the same problem here:

Error while trying to connect to the MySQL database:
No entry is registered for key ‘db’

My webhoster ist 1and1. They use the following construct for the mysql servername when you use a mysql 5 database:

localhost:/tmp/mysql5.sock

Maybe this is the problem. But i had never any problems with this in the past. Used it on Wordpress and Typo3 installations.

Furthermore I have to turn on the usage of PHP 5 (instead of 4) using the .htaccess file. This is done with the following code:

# PHP5 anschalten fuer 1und1
AddType x-mapp-php5 .php
AddHandler x-mapp-php5 .php

Normally file restrictions are ok on the 1and1 server. After the ftp upload all files are set to 644 and all directories have 755. Just to be sure I chmodded the config and tmp directories to 777. But this did not help.

Hope you find a solution soon. I really would like to use piwik.


(vipsoft) #9

Delete your config.ini.php file and go through the Installation screens again.

For host, enter:

;unix_socket=/tmp/mysql5.sock

(akonze) #10

[quote=vipsoft @ Aug 4 2009, 02:47 PM]Delete your config.ini.php file and go through the Installation screens again.

For host, enter:

;unix_socket=/tmp/mysql5.sock

[/quote]

Sorry, but I have absolutely no idea what you mean. style_emoticons/<#EMO_DIR#>/sad.gif There is no config.ini.php file (I looked in the config folder). When I go through the installation again, there is no ‘host’ field where I can enter the data. When I start the install I 1. see a welcome screen, 2. see a screen where my server is checked (everything ok and green btw) and finally the screen where I can enter the database information. It has the following fields:

  • mysql server
  • login
  • password
  • database name
  • table prefix

I tried to enter ‘;unix_socket=/tmp/mysql5.sock’ into the mysql server field, but got the same error message.


(nastytoe) #11

I had a similar problem. While it could be a number of things, your config file might not be chmodded correctly. I believe they want it set to 666, if im not mistaken. Can anyone confirm?


(vipsoft) #12

For the MySQL server, try:

localhost;unix_socket=/tmp/mysql5.sock

(nattfodd) #13

[quote=vipsoft @ Aug 4 2009, 07:46 PM]For the MySQL server, try:

localhost;unix_socket=/tmp/mysql5.sock

[/quote]

It doesn’t change anything here. As I said in the PM I sent you, the problem seems to be that no config.ini.php is ever created. And it doesn’t seem to be a permission problem, as it happens even with everything chmoded to 777.


(vipsoft) #14

I have re-worked unix_socket support for the upcoming Piwik 0.4.3 release. (You can grab a snapshot from svn, if you like.)

If you’re not using unix sockets (e.g., /tmp/mysql5.sock or /var/run/mysqld/mysqld.sock), let me know, so we can dig deeper.


(kiwip) #15

Same problem here, installation fails in step 3 with the message „Error while trying to connect to the MySQL database: No entry is registered for key ‘db’“ (whatever that means, it’s not in the MySQL error list).

  • Piwik 0.4.3
  • Apache/PHP/Piwik has write access to all directories the installation requested, i.e. config/ and tmp/ (obviously, as I did pass steps 1 and 2).
  • There are only config/config.ini.sample.php and config/global.ini.php, no config/config.ini.php.
  • Neither ;unix_socket=/sock/et/path nor localhost;unix_socket=/sock/et/path as database host help (and I wonder why I would need that anyway, socket path is defined in MySQLs/PHPs setup).
  • No error message in Apache’s error log.
  • I can login using the user/password using MySQLs command line tool.
  • It neither works without the to-be-created Piwik database, nor with it (created manually).

Thanks for any help.


(MsvP) #16

EDIT: ok my fault, no problem! :wink:


(sfantu) #17

And what happens if you dont have a good support host ? isnt there a way to do the installation more manually style_emoticons/<#EMO_DIR#>/smile.gif because i have the same problem … its a free host so i dont have support :expressionless:
style_emoticons/<#EMO_DIR#>/rolleyes.gif


(vipsoft) #18

Piwik does not create the database user.

Please make sure that the database user has already been created and granted sufficient privileges.


(wikiwiki) #19

Hi

I had Piwik running fine until i tried to upgrade from 4.2 to 4.3, ie the user/database/tables exist. I have the exact same problem mentioned above:

Error while trying to connect to the MySQL database:
No entry is registered for key 'db'

I tried to reinstall 4.2 which was running fine, but now i get the same error.
Any help would be appreciated.


(mickeyglidewellfy) #20

[quote=wikiwiki @ Aug 17 2009, 10:46 PM]Hi

I had Piwik running fine until i tried to upgrade from 4.2 to 4.3, ie the user/database/tables exist. I have the exact same problem mentioned above:

Error while trying to connect to the MySQL database:
No entry is registered for key 'db'

I tried to reinstall 4.2 which was running fine, but now i get the same error.
Any help would be appreciated.[/quote]

I am having the exact same problem. It’s a pain.