unable to connect to mysql database in Wamp5

This is a discussion on unable to connect to mysql database in Wamp5 within the MySQL Database forums, part of the Database Forums category; Hi I am currently doing a web project using wamp5. Right now this is how i am connecting to the ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-25-2007
scout3014@gmail.com
 
Posts: n/a
Default unable to connect to mysql database in Wamp5

Hi

I am currently doing a web project using wamp5. Right now this is how
i am connecting to the database:


$con = mysql_connect("localhost", "root", "");
if (!con) {
die('Could not Connect' . mysql_error());
}
if (!mysql_select_db("Leave", $con)){
die (mysql_error());
}
else {
........
}

When the code above is activated, this is the result: --->
"Unknown database 'leave' "

Could there be anything in mysql that i might have done wrong that
triggers the error? or maybe there is a problem in my $con object in
the 1st place?

Help is much appreciated

thanks

Reply With Quote
  #2 (permalink)  
Old 07-25-2007
Captain Paralytic
 
Posts: n/a
Default Re: unable to connect to mysql database in Wamp5

On 25 Jul, 05:30, scout3...@gmail.com wrote:
> Hi
>
> I am currently doing a web project using wamp5. Right now this is how
> i am connecting to the database:
>
> $con = mysql_connect("localhost", "root", "");
> if (!con) {
> die('Could not Connect' . mysql_error());
> }
> if (!mysql_select_db("Leave", $con)){
> die (mysql_error());}
>
> else {
> .......
>
> }
>
> When the code above is activated, this is the result: --->
> "Unknown database 'leave' "
>
> Could there be anything in mysql that i might have done wrong that
> triggers the error? or maybe there is a problem in my $con object in
> the 1st place?
>
> Help is much appreciated
>
> thanks


Th bit I don't understand is why the error message refers to "leave"
whilst the db select call is for "Leave"?

Reply With Quote
  #3 (permalink)  
Old 07-25-2007
scout3014@gmail.com
 
Posts: n/a
Default Re: unable to connect to mysql database in Wamp5

On Jul 25, 4:13 pm, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 25 Jul, 05:30, scout3...@gmail.com wrote:
>
>
>
>
>
> > Hi

>
> > I am currently doing a web project using wamp5. Right now this is how
> > i am connecting to the database:

>
> > $con = mysql_connect("localhost", "root", "");
> > if (!con) {
> > die('Could not Connect' . mysql_error());
> > }
> > if (!mysql_select_db("Leave", $con)){
> > die (mysql_error());}

>
> > else {
> > .......

>
> > }

>
> > When the code above is activated, this is the result: --->
> > "Unknown database 'leave' "

>
> > Could there be anything in mysql that i might have done wrong that
> > triggers the error? or maybe there is a problem in my $con object in
> > the 1st place?

>
> > Help is much appreciated

>
> > thanks

>
> Th bit I don't understand is why the error message refers to "leave"
> whilst the db select call is for "Leave"?- Hide quoted text -
>
> - Show quoted text -


i dont understand it myself. Because in my SQLiteManager my database
is named "Leave",
but i am not ruling out the possibility that certain configurations in
e SQLite may hav sth to do with tis.

Reply With Quote
  #4 (permalink)  
Old 07-25-2007
Rik
 
Posts: n/a
Default Re: unable to connect to mysql database in Wamp5

On Wed, 25 Jul 2007 10:43:29 +0200, <scout3014@gmail.com> wrote:
>> Th bit I don't understand is why the error message refers to "leave"
>> whilst the db select call is for "Leave"?- Hide quoted text -
>>

> i dont understand it myself. Because in my SQLiteManager my database
> is named "Leave",
> but i am not ruling out the possibility that certain configurations in
> e SQLite may hav sth to do with tis.



RTFM:
9.2.2. Identifier Case Sensitivity
In MySQL, databases correspond to directories within the data directory.
Each table within a database corresponds to at least one file within the
database directory (and possibly more, depending on the storage engine).
Consequently, the case sensitivity of the underlying operating system
determines the case sensitivity of database and table names. This means
database and table names are not case sensitive in Windows, and case
sensitive in most varieties of Unix.

............

How table and database names are stored on disk and used in MySQL is
affected by the lower_case_table_names system variable, which you can set
when starting mysqld. lower_case_table_names can take the values shown in
the following table. On Unix, the default value of lower_case_table_names
is 0. On Windows, the default value is 1. On Mac OS X, the default is 1
before MySQL 4.0.18 and 2 as of 4.0.18.

Value Meaning
0 Table and database names are stored on disk using the lettercase
specified in the CREATE TABLE or CREATE DATABASE statement. Name
comparisons are case sensitive. Note that if you force this variable to 0
with --lower-case-table-names=0 on a case-insensitive filesystem and
access MyISAM tablenames using different lettercases, this may lead to
index corruption.
1 Table names are stored in lowercase on disk and name comparisons are not
case sensitive. MySQL converts all table names to lowercase on storage and
lookup. This behavior also applies to database names as of MySQL 4.0.2,
and to table aliases as of 4.1.1.
2 Table and database names are stored on disk using the lettercase
specified in the CREATE TABLE or CREATE DATABASE statement, but MySQL
converts them to lowercase on lookup. Name comparisons are not case
sensitive. Note: This works only on filesystems that are not case
sensitive! InnoDB table names are stored in lowercase, as for
lower_case_table_names=1. Setting lower_case_table_names to 2 can be done
as of MySQL 4.0.18.
--
Rik Wasmus
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:23 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0