igmenezes / concerto-platform

Automatically exported from code.google.com/p/concerto-platform
0 stars 0 forks source link

MySQL connection test fails without any useful output #66

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install v4.0.0.beta8 on Centos 6.6
2. Point URL at http://blahblah/concerto/setup

What is the expected output? What do you see instead?
The MySQL test failed but there is no error message. The recommendation is: 
"Please contact us about this problem."

What version of the product are you using? On what operating system?
v4.0.0.beta8 on Centos 6.6

Please provide any additional information below.
I'm following these instructions: 
https://code.google.com/p/concerto-platform/wiki/installation4 . I don't use 
RMySQL much but I tried and seemed to make a connection using the credentials 
in SETTINGS.php. It would be helpful if I could get an error message.

Original issue reported on code.google.com by alan.d.m...@gmail.com on 22 Dec 2014 at 7:24

Attachments:

GoogleCodeExporter commented 8 years ago
Can you please post your SETTINGS.php file.
Did you managed to run successfully any other PHP application using MySQL?

Original comment by LisPrzem...@gmail.com on 23 Dec 2014 at 6:26

GoogleCodeExporter commented 8 years ago
If you can send it to me, I can run a simple PHP command line or snippet to 
check MySQL connectivity.  I don't have any other PHP applications in this 
host.  

I did install these CentOS packages (MySQL was already installed):

mysql-devel
php-common
php
php-cli
libxslt
php-xml
php-pear
php-pear-DB

Here is my SETTINGS.php:

<?php
//MySQL
$db_host = "localhost"; //MySQL server host
$db_port = "3306"; // MySQL server port
$db_master_user = "con"; // MySQL user name with ALL privileges
$db_master_password = "XXXXXXXXXX"; // MySQL password for user with ALL 
privileges
$db_master_name = "con"; // Concerto master MySQL database name ( user need to 
create it manually prior to running /setup )
$db_users_name_prefix = "concerto_"; // prefix for MySQL user names created by 
Concerto ( workspace id will be appended to it ) - SET IT ONLY ONCE PRIOR TO 
RUNNING /setup
$db_users_db_name_prefix = "concerto_"; // prefix for MySQL database names 
created by Concerto ( workspace id will be appended to it ) - SET IT ONLY ONCE 
PRIOR TO RUNNING /setup

//paths
$path_external = "http://erlab.org/con/"; // Concerto full URL ending with 
slash character ('/'), e.g. http://domain.com/concerto/
$path_r_script = "/usr/lib64/R/bin/Rscript"; // Rscript executable path, e.g. 
/usr/bin/Rscript
$path_r_exe = "/usr/bin/R"; // R executable path, e.g. /usr/bin/R
$path_php_exe = "/usr/bin/php"; // php executable path, e.g. /usr/bin/php
$path_sock = ""; // socks directory path ending with slash character ('/'), 
leave blank for default - /[concerto_installation_path]/socks/
$path_data = ""; // data directory path ending with slash character ('/'), 
leave blank for default - /[concerto_installation_path]/data/

//R connection
$server_socks_type = "UNIX"; // socket server type ( UNIX or TCP, UNIX highly 
reccomended )
$server_host = "127.0.0.1"; // choose host to connect to ( only when TCP )
$server_port = "8888"; // choose port used for connection ( only when TCP )
$r_instances_persistant_instance_timeout = 60 * 15; // after set period of 
instance inactivity in seconds the instance will be serialized and closed
$r_instances_persistant_server_timeout = 60 * 20; // after set period of server 
inactivity in seconds the server will be closed ( new instances can restart it 
anytime )
$r_max_execution_time = 30; // maximum R execution time after which instance 
will be terminated ( prevents infinite loops in R on server )
$unix_locale = ""; // Unix locale LANG variable. Must be installed on the 
system. Leave blank for none/default, e.g. en_GB.UTF8
$timer_tamper_prevention = false; // DEPRECATED
$timer_tamper_prevention_tolerance = 30; // DEPRECATED

//general
$timezone = 'America/Chicago'; // PHP timezone settings
//$mysql_timezone = '+0:00'; // MySQL timezone settings, leave blank to make it 
the same as $timezone
$mysql_timezone = ''; // MySQL timezone settings, leave blank to make it the 
same as $timezone
$public_registration = false; // is open registration from login form allowed
$cms_session_keep_alive = true; // prevents session expiry when in panel
$cms_session_keep_alive_interval = 300000; // time interval between session 
keep alive requests in miliseconds

//remote client
$remote_client_password = "pass"; // password required by remote clients to use 
this Concerto server

//cron
$r_users_name_prefix = "concerto_"; // prefix for Linux users created by 
Concerto ( user id will be appended to it ) - SET IT ONLY ONCE PRIOR TO RUNNING 
/setup
$r_users_group = "concerto"; // Linux group name for users above
$php_user = "apache"; // php user name
$php_user_group = "apache"; // group of php user above

//logs
$log_server_events = false; // socket communication info and test server php 
errors will be printed to a text file in data directory
$log_server_streams = false; // socket streams will be logged too
$log_js_errors = true; // logs all test specific js errors from client side
$log_r_errors = true; // logs all test specific R errors

//ALWAYS RUN /setup AFTER CHANGING SETTINGS IN THIS FILE!
?>

Original comment by alan.d.m...@gmail.com on 23 Dec 2014 at 8:10

GoogleCodeExporter commented 8 years ago
Also, I created the database and user with these two lines of SQL:

create database con;
grant all privileges on con.* to con@localhost identified by 'XXXXXXXXXXXXX';

Original comment by alan.d.m...@gmail.com on 23 Dec 2014 at 8:13

GoogleCodeExporter commented 8 years ago
I found a PHP test script:
<?php
  $connect=mysql_connect('localhost','con','XXXXXX') or die('Unable to Connect');
  mysql_select_db('con') or die('Could not open the db');
  $showtablequery='SHOW TABLES FROM con';
  $query_result=mysql_query($showtablequery);
  while($showtablerow = mysql_fetch_array($query_result)) {
    echo $showtablerow[0].' ';
  }
?>

It gave me an error "Fatal error: Call to undefined function mysql_connect()"

I googled this and needed to install php-pdo and php-mysql.

Now the next two tests regarding the table structure fail. How do I 
trouble-shoot that?

Original comment by alan.d.m...@gmail.com on 23 Dec 2014 at 9:14

GoogleCodeExporter commented 8 years ago

Original comment by alan.d.m...@gmail.com on 23 Dec 2014 at 10:07

Attachments:

GoogleCodeExporter commented 8 years ago
Are you 100% sure your MySQL user declared in SETTINGS.php have ALL privileges 
and GRANT option turned on? 

Original comment by LisPrzem...@gmail.com on 27 Dec 2014 at 4:02

GoogleCodeExporter commented 8 years ago
I have added "WITH GRANT OPTIONS" to the grant statement. I am 100% sure that I 
used the below commands to create the database and user. Is that the correct 
grant statement? Or do you have a test I should perform? Below that is the 
table structure I see after the errors. The errors are unchanged.

$ mysql -u root -p < create.sql
$ cat create.sql
drop database if exists con;
create database con;
grant all privileges on con.* to con@localhost identified by 'XXXXXXX' WITH 
GRANT OPTION;

***** here I re-run the test in the browser (which still fail in exactly the 
same way)

$ mysql -u root -p con
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4651
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show tables;
+------------------------+
| Tables_in_con          |
+------------------------+
| DS_Module              |
| DS_UserInstitutionType |
| RDoc                   |
| RDocFunction           |
| RDocLibrary            |
| Setting                |
| User                   |
| UserFunction           |
| UserR                  |
| UserShare              |
| UserWorkspace          |
+------------------------+
11 rows in set (0.00 sec)

Original comment by alan.d.m...@gmail.com on 28 Dec 2014 at 3:29

GoogleCodeExporter commented 8 years ago
Master user needs rights to create new databases.

grant all privileges on con.* to con@localhost identified by 'XXXXXXX' WITH 
GRANT OPTION;

... needs to be replaced with:

grant all privileges on *.* to con@localhost identified by 'XXXXXXX' WITH GRANT 
OPTION;

Original comment by LisPrzem...@gmail.com on 28 Dec 2014 at 2:11

GoogleCodeExporter commented 8 years ago
That did it; thanks!

Original comment by alan.d.m...@gmail.com on 28 Dec 2014 at 8:09

GoogleCodeExporter commented 8 years ago

Original comment by LisPrzem...@gmail.com on 29 Dec 2014 at 12:58