Loading...
 
Skip to main content

Architecture / Installation


Unable to login to MySQL

I can login to MySQL from a MySQL console, but tiki-install.php cannot.

It comes back with "Tiki cannot find a database connection" (Tiki installer v1.7.3 -Eta Carinae)

I see several dozen sites with this problem when I google the phrase "Unable to login to the MyQL database" + tiki.

But I see no discussion of it here.

don has posts that seem related, but not exactly my problem.

This is my very first attempt to install Tiki. (try it at tiki.skybuilders.com/tiki-install.php)

Thanks for any help. I will post the solution here for others.

Bob Doyle
ed...@cm...

No intent to insult you, but have you created the "Tiki" database yet and run the script to set it up?

> bzahn wrote:
> No intent to insult you, but have you created the "Tiki" database yet and run the script to set it up?
>

Yes, we created the main MySQL database using mysqladmin in the normal way. It seems perfectly normal - MySQL shell scripts work fine.

We have setup to have multiple wikis (these may be part of our problem, but we don't think so. We ran setup.sh with two domain names, added the VirtualServer blocks to httpd.conf, and the conditional values for host, pass, user in local.php, etc.).

The first site is at tiki.skybuilders.com (a test site for CMS Review http://www.cmsreview.comQuestion)
Second is at cmswiki.com (to be a knowledge site for CMS community).

We tried to run tiki-install.php for both of these sites. That should create the database tables. But it always fails.

So we ran tiki.sql for the cmswiki.com case, and it worked fine. We can see all the tables in the MySQL console. Associated user has all the right privileges.
_

So our main symptom is the message "Unable to login to the MySQL database 'tiki_sky_com' on 'localhost' as user 'tiki_sky_com' " when we go to tiki.skybuilders.com.

We echo out the dsn connection string and it looks fine, has the right password, etc.

But we suspect the problem is in this connection string, maybe a PEAR issue?

Bob Doyle
mailto:ed...@cm...

> We have setup to have multiple wikis (these may be part of our problem, but we don't think so. We ran setup.sh with two domain names, added the VirtualServer blocks to httpd.conf, and the conditional values for host, pass, user in local.php, etc.).



My experience is just with the Windows world. Sounds like you're using Linux. I may not be able to help much more. Have you also taken care of any permissions issues? Does your Tiki admin account have proper rights to the MySQL database?


> bzahn wrote:
> No intent to insult you, but have you created the "Tiki" database yet and run the script to set it up?
>

Yes, we created the main MySQL database using mysqladmin in the normal way. It seems perfectly normal - MySQL shell scripts work fine.

We have setup to have multiple wikis (these may be part of our problem, but we don't think so. We ran setup.sh with two domain names, added the VirtualServer blocks to httpd.conf, and the conditional values for host, pass, user in local.php, etc.).

The first site is at tiki.skybuilders.com (a test site for CMS Review http://www.cmsreview.comQuestion)
Second is at cmswiki.com (to be a knowledge site for CMS community).

We tried to run tiki-install.php for both of these sites. That should create the database tables. But it always fails.

So we ran tiki.sql for the cmswiki.com case, and it worked fine. We can see all the tables in the MySQL console. Associated user has all the right privileges.
_

So our main symptom is the message "Unable to login to the MySQL database 'tiki_sky_com' on 'localhost' as user 'tiki_sky_com' " when we go to tiki.skybuilders.com.

We echo out the dsn connection string and it looks fine, has the right password, etc.

But we suspect the problem is in this connection string, maybe a PEAR issue?

Bob Doyle
mailto:ed...@cm...

> We have setup to have multiple wikis (these may be part of our problem, but we don't think so. We ran setup.sh with two domain names, added the VirtualServer blocks to httpd.conf, and the conditional values for host, pass, user in local.php, etc.).



My experience is just with the Windows world. Sounds like you're using Linux. I may not be able to help much more. Have you also taken care of any permissions issues? Does your Tiki admin account have proper rights to the MySQL database?


Hi!

I've just surfed over to your Tiki-install.php, it seems to be waiting for you to enter your database username and password.

Please also check that apache can write to the /db/ folder so that it can create a file called local.php
You may want to create this manually.


Merry Christmas!
Damian



Have you tried doing the PEAR test?

If you search tw.o for PEAR test I think its on the Install Tiki Safe Mode page. To make sure your pear is good and working

Damian


We have found a source for this problem.

When you can run MySQL, but PHP cannot find the database, it may be because MySQL was installed after the PHP installation (This was true in our case).

So when PHP compiled, it did not include MySQL support.

You can prove this is the problem because the mysql.so file will be missing from /usr/lib/php4.

Another indicator is that MySQL may appear in the Core section of PHPinfo (e.g., "--with-mysql=shared,/usr") but there will be no enumeration of MySQL as a module block below.

Ths solution is to recompile PHP with MySQL support, or do a fresh OS install with both included.

Thanks for all who helped with this.


> Ths solution is to recompile PHP with MySQL support, or do a fresh OS install with both included.
>
> Thanks for all who helped with this.

Im glad you managed to get this sorted out!

Thanks for posting back with the answer, lets hope it will help someone else as well.

Enjoy Tiki!

Damian



> Ths solution is to recompile PHP with MySQL support, or do a fresh OS install with both included.
>
> Thanks for all who helped with this.

Im glad you managed to get this sorted out!

Thanks for posting back with the answer, lets hope it will help someone else as well.

Enjoy Tiki!

Damian


If you're running FreeBSD, and you install everything through the ports system, don't forget that you might have to reboot the machine to update your environment correctly. For some reason, restarting the database and web servers weren't good enough, and I couldn't connect via php until I restarted the computer.

I had the same problem on my server (debian woody with a 2.4.24 kernel). It turns out that mysql.sock was not in the default location. After perusing the documentation and failing to properly specify mysql.sock's location, I just edited my.cnf and put mysql.sock in /tmp, and restarted the server. ta-da!. Connection established.

by the by, where *do* I specify mysql.sock's location?

> by the by, where *do* I specify mysql.sock's location?

This is the contents of my /etc/my.cnf on my Fedora Core 1 machine:

Copy to clipboard
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock [mysql.server] user=mysql basedir=/var/lib [safe_mysqld] err-log=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid

Hope it helps people.

Damian

Sorry I wasn't a little more clear in my question... where in tikiwiki would I specify the location of mysql.sock? I understand setting up/configuring/running mysql - it's the tikiwiki end that has me confused.

thanks 😊



> Damian:
> > by the by, where *do* I specify mysql.sock's location?
>
> This is the contents of my /etc/my.cnf on my Fedora Core 1 machine:

>
Copy to clipboard
> [mysqld] > datadir=/var/lib/mysql > socket=/var/lib/mysql/mysql.sock > > [mysql.server] > user=mysql > basedir=/var/lib > > [safe_mysqld] > err-log=/var/log/mysqld.log > pid-file=/var/run/mysqld/mysqld.pid >

> Hope it helps people.
>
> Damian


> by the by, where *do* I specify mysql.sock's location?

This is the contents of my /etc/my.cnf on my Fedora Core 1 machine:

Copy to clipboard
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock [mysql.server] user=mysql basedir=/var/lib [safe_mysqld] err-log=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid

Hope it helps people.

Damian

Sorry I wasn't a little more clear in my question... where in tikiwiki would I specify the location of mysql.sock? I understand setting up/configuring/running mysql - it's the tikiwiki end that has me confused.

thanks 😊



> Damian:
> > by the by, where *do* I specify mysql.sock's location?
>
> This is the contents of my /etc/my.cnf on my Fedora Core 1 machine:

>
Copy to clipboard
> [mysqld] > datadir=/var/lib/mysql > socket=/var/lib/mysql/mysql.sock > > [mysql.server] > user=mysql > basedir=/var/lib > > [safe_mysqld] > err-log=/var/log/mysqld.log > pid-file=/var/run/mysqld/mysqld.pid >

> Hope it helps people.
>
> Damian


I had the same problem (== symptoms) but the solution was different.

I hacked a little bit in the tiki-install.php script and just put 'phpinfo();' in.
When running that page I found out that the module to access mysql was missing !!

I installed it through the usuall urpmi commands and it all seems to work now.

For the record: ts a Intel86 box with mandrake linux 9.0

Maybe someone could modify the tiki-installscript to include this phpinfo if a connection goes wrong?

Must continue installing it all now ...😀


I have the exact same problem that Tiki can not find a database connection - when I enter the correct database info the page refreshes (tiki_install) with localhost again. I have changed the tiki_db.php tfil to the correct information.

I have an account on a linux server, the connection is not in safe_mode but I have only access to one database. I have set all the correct permissions as outlined in the manual. I have done the tests to check that pear is installed (and am assured by the server administrator that it is).

I run other scripts from my account where php connects to my mysql database. So I don't think I have the problem that is outlined earlier (the order of installation).

Does anyone have any tips of how I can explain the problem to my (over worked) server administrator?

Thanks for any help

If your in 1.8, make sure you choose Mysql 3 or mysql 4 accordingly 😉

Database user must have a password too.

also i think changing the tiki-db.php is obselete and it requires the use of local.php instead
you could also check the permissions are set so that db/ can be written to as well as a /temp/ in your tikiroot.


> kage:
> I have the exact same problem that Tiki can not find a database connection - when I enter the correct database info the page refreshes (tiki_install) with localhost again. I have changed the tiki_db.php tfil to the correct information.
>
> I have an account on a linux server, the connection is not in safe_mode but I have only access to one database. I have set all the correct permissions as outlined in the manual. I have done the tests to check that pear is installed (and am assured by the server administrator that it is).
>
> I run other scripts from my account where php connects to my mysql database. So I don't think I have the problem that is outlined earlier (the order of installation).
>
> Does anyone have any tips of how I can explain the problem to my (over worked) server administrator?
>
> Thanks for any help

> also i think changing the tiki-db.php is obselete and it requires the use of local.php instead


Thanks for you help. This was a bit vague in the manual. Is there an updated manual now?

Rachael
(kage - password retreival doesn't work!)