Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » MySQL error during install

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

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

Page: 1
Go to End
Author Topic: 2512 Views
  • reddirtranch
    Avatar
    Community Member
    3 Posts

    MySQL error during install Link to this post

    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!

  • Matt
    Avatar
    Core Development Team
    84 Posts

    Re: MySQL error during install Link to this post

    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()));

  • reddirtranch
    Avatar
    Community Member
    3 Posts

    Re: MySQL error during install Link to this post

    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.

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: MySQL error during install Link to this post

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

  • doug
    Avatar
    Community Member
    1 Post

    Re: MySQL error during install Link to this post

    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.

  • coconutrandom
    Avatar
    Community Member
    2 Posts

    Re: MySQL error during install Link to this post

    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.

    2512 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.