Banshee
the secure PHP framework

Forum

Installing Banshee with remote(LAN) MySQL Database

Alexander
14 july 2015, 02:00
Hello, I'd like to use banshee.
When doing the ./setup_database step, it first creates a user that only has rights on localhost, which is pretty useless when I need remote access from a LAN IP.

I just changed every occurence of localhost to my LAN IP.

That works, the user gets correctly created, now this is happening:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
SQL query: select value, UNIX_TIMESTAMP(timeout) as timeout from cache where `key`='settings_last_updated' limit 1
Error message: Table 'or.cache' doesn't exist
and so on.

There is absolutely nothing written into that database. It tries once more, to connect to localhost which doesn't work. Any way to tell it the correct host? I've set everything correct in the website conf.

Greetings,
Alex
Hugo Leisink
14 july 2015, 10:45
I must admit that I haven't tested much with a remote MySQL database, as I don't own many servers. What you can do is import the file database/mysql.sql manually into your database. Remove the user that the Banshee setup script created and create a new one. I see that there is an error at lines 60 and 74 (hardcoded 'localhost') of that script.

The next version will have a web based setup procedure. I'll make sure a remote MySQL server is well supported.


Update:
I've fixed the setup_database script in the current 5.0 release.
Alexander
15 july 2015, 10:24
Thanks for that, one file less to edit . I still experience problems though.

Now when setting the DB IP as the db host, it connects there, creates access rights only from the DB IP and thats it, blocked out.

Now when changing the users access to the IP that should have access, it starts doing weird stuff like:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
SQL query: select value, UNIX_TIMESTAMP(timeout) as timeout from cache where `key`='settings_last_updated' limit 1
Error message: Table 'or.cache' doesn't exist
SQL query: delete from cache where `key`='settings_last_updated' limit 1

Why would it start to try using local MYQL sockets now, I still stated the DB IP in the website config?
Oh and after manually changing the users host to my webservers LAN IP, the script creates another user with empty password.

It refuses creating tables that way.

I must say that I changed the MONTHS_OF_YEAR and DAYS_OF_WEEK to german, if that affects anything?
And I'm testing banshee on a nonexistent domain via hosts file, if thats another reason why I'm getting white page even after inserting the sql file manually, running the setup_database script again changes nothing.

Hiawatha config:
VirtualHost {
Hostname = dom523552.de, www.dom523552.de
WebsiteRoot = /var/www/dom523552.de/public
AccessLogfile = /var/log/hiawatha/dom523552.de.access.log
ErrorLogfile = /var/log/hiawatha/dom523552.de.error.log
StartFile = index.php
UseFastCGI = dom523552
TimeForCGI = 120
PreventXSS = yes
PreventSQLi = yes
PreventCSRF = yes
UseToolkit = banshee
}

Greetings
Alexander
Hugo Leisink
17 july 2015, 16:11
Like I said, manually import the database and manually create a DB user for now. I'll take a look at it for the next release.
Message preview

The following BB-codes are available in a message:

  • [b]Bold text[/b]
  • [center]Center text or imagen[/center]
  • [color=color name or #RGB code]Colored text[/color]
  • [i]Italic text[/i]
  • [img]Link to image[/img]
  • [right]Align text or image right[/right]
  • [s]Strike-through text[/s]
  • [size=pixelsize]Big or small text[/size]
  • [u]Underlined text[/u]
  • [url]Link to website[/url]
  • [url=link to website]Link text[/url]