Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

MySQL error during install


Reply


6 Posts   2599 Views

Avatar
reddirtranch

Community Member, 3 Posts

15 February 2007 at 6:53pm

I'm trying a first time install on a cpanel server, I have PHP5 and MySQL 4.1.21 , apache 1.3.37.

When I run install.php I get errors at the top of the page:

Warning: mysql_get_server_info() [function.mysql-get-server-info]: Access denied for user

and below the MySQL section, everything is OK except for this line:

MySQL version at least 4.1   MySQL version 4.1 is required, you only have ..

Is there a way to manually tell the install the MySQL version or trick MySQL into telling its version?

Thanks!

Avatar
Matt

Core Development Team, 84 Posts

15 February 2007 at 11:17pm

If you know that you have MySQL 4.1 or better installed, then feel free to search for the following line and place two forward slashes in front of it:

$this->requireMySQLVersion("4.1", array("MySQL Configuration", "MySQL version at least 4.1", "MySQL version 4.1 is required, you only have ", "MySQL " . mysql_get_server_info()));

Should become:

// $this->requireMySQLVersion("4.1", array("MySQL Configuration", "MySQL version at least 4.1", "MySQL version 4.1 is required, you only have ", "MySQL " . mysql_get_server_info()));

Avatar
reddirtranch

Community Member, 3 Posts

16 February 2007 at 7:52am

Thanks Matt, I got past that hurdle, when running the install it overwrites the .htaccess where I must have

AddHandler application/x-httpd-php5 .php .php4 .php3 .phtml

I was attempting to install in my root (public_html) directory, not public_html/silverstripe-v2.0/

Once I ran the install in the subdirectory it installed fine.

Avatar
Sam

Administrator, 685 Posts

16 February 2007 at 8:56am

We'll need to update the installer so that it merges with the existing .htaccess file if one already exists.

Avatar
doug

Community Member, 1 Post

27 February 2007 at 8:44am

Commenting that line out worked like a charm.

I also had the .htaccess problem, however.

Here's what I did:

1 - Go to the section of install.php that writes the .htaccess file (around line 501)

2 - Insert "AddHandler application/x-httpd-php5 .php" after this line:

$this->createFile(".htaccess", <<<TEXT

3 - Save and upload.

Avatar
coconutrandom

Community Member, 2 Posts

6 March 2007 at 12:28am

Edited: 06/03/2007 12:32am

I found that my host has some pretty strict requirements on accessing the database. Somewhere in the MySQL docs I read this and added it line 22 of install.php. Fixed it perfectly! Of course you'll want your info in there and to make sure the install.php is not accessible afterwards.

//-----
$link = mysql_connect('DATABASESERVER', 'USERNAME', 'PASSWORD');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
//------

Perhaps it will work for you.