This forum is no longer active. Please post your questions to our new community site

Forums Liferay

Liferay & phpmyadmin

Subscribe to Liferay & phpmyadmin 12 post(s), 4 voice(s)

 
Avatar mr.mojo 1 post

Hey,
There are already installed databases of other projects. Is there a way to display the liferay database in phpmyadmin? During the installation of BitNami Liferay is created even a mySQL database. How can I see this path now in phpmyadmin?

my setup: ubuntu/Apache/Tomcat/MySQL

 
Avatar dennismonsewicz 2 post(s)

I use navicat and when you create a new connection, just put the port you are using that mysql instance on…

For example:

I run my liferay mysql instance on port 3307 instead of 3306 (MAMP mysql runs on 3306)

 
Avatar Sean 12 post(s)

I am having a similiar problem.

I downloaded the liferay vm box with Ubuntu. I then installed the desktop environment for Ubuntu, and I am even updated to 10.10. I would like to get phpmyadmin setup but before installing that I have installed the MySQL Administrator from the Ubuntu Software center. It asks to specify the hostname, username and password.

I got the username and password from /opt/bitnami/apache-tomcat/webapps/liferay/META-INF/context.xml and in that screen i enter in the hostname as “localhost” and specify the port as 3306. I know that is right because I know liferay is using that.

I also know the mysql server is running because the liferay portal itself works and when running ‘sudo /opt/bitnami/ctlscrip.sh status’ it replies and says ‘tomcast already running’ and ‘mysql already running’.

So any clues as to why i can not connect to the MySQL Database manually?

 
Avatar Sean 12 post(s)

Sorry one more thing.

Since I am running the vmware box I would also like to note that from the host operating system computer (Windows 7 Enterprise Edition). I did a “telnet [ip obtained from ifconfig on vmware machine] 3306” but that connection fails as well, which again doesn’t make sense since it detects the mysql service is running.

Thanks,
Sean W.

 
Avatar Sean 12 post(s)

Ok actually found the resolution regarding the “MySQL Admin” program I downloaded via the Ubuntu Software center.

After following the guidelines here: http://forums.mysql.com/read.php?10,4753,56984#msg-56984

I looked at my /opt/bitnami/mysql/my.cnf file and determined that my socket file was at /opt/bitnami/mysql/tmp/mysql.sock

After specifying that additional information in to the “MySQL Admin” program I was able to use that application.

Also the “MySQL Query Browser” program that I downloaded from the software center seems to work fine now as well with the information in my /opt/bitnami/apache-tomcat/webapps/liferay/META-INF/context.xml file.

So next steps are certainly to see if I can get the phpmyadmin to work. But with the MySQL Query Browser working, im not sure how much I will persue it :).

Thanks,
Sean W.

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

In this FAQ you can find how to configure the Virtual Appliance to access to phpMyAdmin or open the MySQL port: http://bitnami.org/faq/virtual_machines

I hope it helps.

 
Avatar Sean 12 post(s)

Thanks Beltra, and normally it would help, however on the liferay vm when you go to /opt/bitnami/apps/ phpmyadmin does not exist.

I did notice on the standard LAMP Stack VM’s this path exists but on the Liferay VM it does not. I assume that is because of how different apache-tomcat is vs the standard apache webserver, but ya I hope to get through it.

Thanks,
Sean W.

 
Avatar Sean 12 post(s)

Here is an additional tidbit of information as well.

I created a new folder called “mystuff”, full path: /opt/bitnami/apache-tomcat/webapps/ROOT/mystuff

I created a “phpinfo.php” file, with the phpinfo(); function in it (with the < and ? in and ? and > in the appropriate places as well).

Went to http://localhost/mystuff/phpinfo.php and was unable to display anything.

Appears that php is not built in to this tomcat build on the vm.

I found this website hopefully it will help me compile tomcat with php (if i understand the instructions on the site correctly).

http://wiki.apache.org/tomcat/UsingPhp

Either that or I just may install a standard apache / php instance, unfortunately that would have to run on a different port, but I have never done anything like the steps specified in the above mentioned web page so I guess I have to pick and choose my battle :). Ya know is it worth trying to follow the steps to compile tomcat and php so that i can do http://localhost/phpmyadmin/, or is it easy enough to do something somewhat familiar with only one small hitch, having to do something like http://localhost:81/phpmyadmin/. We will see I suppose :).

Thanks,
Sean W.

 
Avatar Sean 12 post(s)

Ok so I did end up deciding to go the route of installing a new Apache HTTPD instance on the server listening on Port 81.

So officially http://localhost:81/phpmyadmin/ works at this point in time.

Since I had the Ubuntu Desktop installed on the VMbox i just used FireFox and gEdit for most of the stuff.

So using firefix I download:
httpd-2.2.17.tar.gz
php-5.3.3.tar.gz
phpMyAdmin-3.3.8.1-english.tar.gz

I extracted them to my /home/bitnami/ folder
I pulled up a terminal:
cd httpd-2.2.17
(effectively /home/bitnami/httpd-2.2.17/ or /~/httpd-2.2.17/)
./configure —prefix=/opt/bitnami/apache2
make
sudo make install
sudo chown bitnami /opt/bitnami/apache2
sudo chown bitnami /optbitnami/apache2/
sudo chown bitnami /optbitnami/apache2/*
(over kill but i didn’t want to miss a thing)

Opened gEdit and opened /opt/bitnami/apache2/httpd.conf
Changed “Listen 80” to “Listen 81”
Saved httpd.conf
Switched back to the terminal:
sudo /opt/bitnami/apache2/bin/apachectl -k start
Opened firefox, verified that http://localhost:81 displayed a page. (It Worked!), hurray!

Opened the Ubuntu software center
Installed “libxml2-dev”

Switched back to the terminal
cd .. (to go back to ~ or /home/bitnami)
cd php-5.3.3 (effectively /~/php-5.3.3 or /home/bitnami/php-5.3.3)
./configure —with-apxs2=/opt/bitnami/apache2/bin/apxs —with-mysql=/opt/bitnami/mysql
make
sudo make install
sudo gedit
opened /home/bitnami/php-5.3.3/php.ini-development
Saved as /usr/local/lib/php.ini
The most significant change that I made was:
mysql.default_socket =/opt/bitnami/mysql/tmp/mysql.sock
Saved the file again
Opened /opt/bitnami/apache2/conf/httpd.conf
Ensured that I had:

LoadModule php5_module modules/libphp5.so

and:

<FilesMatch \.php$>
SetHandler application/x-httpd-php

Saved that file as well
Exited out of gEdit
(terminal is now typable again)
sudo /opt/bitnami/apache2/bin/apachectl restart

Opened gedit again
made: /opt/bitnami/apache2/htdocs/phpinfo.php with the appropriate phpinfo(); function and syntax
In firefox went to http://localhost:81/phpinfo.php (yeah php info stuff)
In gedit also made /opt/bitnami/apache2/htdocs/mysql_connect.php with the appropriate code and syntax to verify connectivity.
In firefox went to http://localhost:81/mysql_connect.php (Connection succesfull, yeah!)

Using the file explorer in ubuntu i create /opt/bitnami/apache2/htdocs/phpmyadmin/
I also copied the contents of /home/bitnami/phpMyAdmin-3.3.8.1-english to /opt/bitnami/htdocs/phpmyadmin/
In the terminal did:
mkdir /opt/bitnami/apache2/htdocs/phpmyadmin/config
sudo chmod o+rwx /opt/bitnami/apache2/htdocs/phpmyadmin
sudo chmod o+rwx /opt/bitnami/apache2/htdocs/phpmyadmin/

In firefox went to:
http://localhost:81/phpmyadmin/setup/index.php
New Server
Verbos name: (left blank)
Server hostname: localhost
server port: 3306
Server socket: /opt/bitnami/mysql/tmp/mysql.sock
Use SSL: cleared
Connection type: tcp
Phph extension to use: mysql
Compress connection: cleared
Authentication type: cookie
User for config auth: root
Password for config auth: bitnami (note if you have changed your root password that should be entered here)
Connect without password (cleared)
SweKey config file (cleared)
Save button

Changed url to http://localhost:81/phpmyadmin/index.php
username: root
password: bitnami

And that seemed to sign in, and I can certainly see my “bitnami_liferay” database there.

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

Thanks for posting your solution. You are right, we did not include phpMyAdmin for Java based stacks. An easy solution for this you can install a BitNami LAMP Stack in the machine and use a different port (81 for instance). Then you only have to configure phpMyAdmin to access to the Liferay database instead of the LAMP database.

 
Avatar Sean 12 post(s)

Thanks beltran. Since you mentioned it I tried this solution as well.

During the installation I specified the apache port as 82 and the mysql as 3307, and /opt/bitnami/lampstack-1.2-3/ as the installation path.

After installation the http://127.0.0.1:82/phpmyadmin/ site connected to the newly created 3307 database.

In order to get to the liferay database I had to edit the /opt/bitnami/lampstack-1.2-3/php/etc/php.ini file to connect to 3306 and also specified the socket as /opt/bitnami/mysql/tmp/mysql.sock (the sock file liferay uses).

Saved the file and restarted the newly installed apache (/opt/bitnami/lampstack-1.2-3/apache2/bin/apachectl restart

After that I went back to http://127.0.0.1:82/phpmyadmin/ and sure enough the liferay database is there as well.

Seems that sock file is very important for this connection, so thank you very much for this information.

Thanks,
Sean W.

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Right, you should specify the socket location for MySQL database. I’m glad to hear you tried my solution :)

Forums Liferay