diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-01-20 04:56:10 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-01-20 04:56:10 +0000 |
commit | 8384cac5e3f300c5ca13b0bf5a9c689c0b4202e9 (patch) | |
tree | 621cdf40f2ab8fb02bb115c3078d62825e17de21 | |
parent | 0c6b36b086db5dfaa7c0e778296a36104fc2468d (diff) |
Deal gracefully with bad mysql connection and database information.
-rw-r--r-- | installer/installer.php | 2 | ||||
-rw-r--r-- | installer/views/invalid_db_info.html.php | 6 | ||||
-rw-r--r-- | installer/views/missing_db.html.php | 13 |
3 files changed, 19 insertions, 2 deletions
diff --git a/installer/installer.php b/installer/installer.php index cf4f41d1..cd410571 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -78,7 +78,7 @@ class installer { } static function connect($config) { - return mysql_connect($config["host"], $config["user"], $config["password"]); + return @mysql_connect($config["host"], $config["user"], $config["password"]); } static function select_db($config) { diff --git a/installer/views/invalid_db_info.html.php b/installer/views/invalid_db_info.html.php new file mode 100644 index 00000000..242a28a5 --- /dev/null +++ b/installer/views/invalid_db_info.html.php @@ -0,0 +1,6 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<h1> Uh oh! </h1> +<p class="error"> + We were unable to connect to your MySQL server with the username and + password that you provided. Please go back and try again! +</p> diff --git a/installer/views/missing_db.html.php b/installer/views/missing_db.html.php index 1f93f08a..fa42fde5 100644 --- a/installer/views/missing_db.html.php +++ b/installer/views/missing_db.html.php @@ -1,2 +1,13 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<h1> Can't find that database! </h1> +<p class="error"> + We were able to connect to your MySQL server, yay! But the database + name you gave us doesn't exist and we don't have permissions to + create it for you. Please create the database manually, then go + back and try again. +</p> + <p> - <
\ No newline at end of file + If you're having trouble creating the database, please contact your + web host or system administrator for assistance. +</p> |