List:MySQL and .NET« Previous MessageNext Message »
From:Reggie Burnett Date:February 21 2007 4:00pm
Subject:RE: Trouble connecting to a database with a dash in its name (1.0.9)
View as plain text  
> 
> Hellos,
> 
> I upgraded to 1.0.9 And I can't connect to databases containing dashes
> in their names anymore. Or maybe it's because I have a dash in my user
> name... Can anyone help me with this, please?
> 
> The errors:
> Connecting to database try #1:
> Error connecting to the database!
> MySql.Data.MySqlClient.MySqlException:
> You have an error in your SQL syntax. Check the manual that corresponds
> to your MySQL server version for the right syntax to use near
> '-last_part_of_db_name_with_dash_in_it' at line 1 at...
> 
> Ok, so I enclose the db name in ``
> 
> Connecting with database name enclosed in ``:
> Error connecting to the database!
> MySql.Data.MySqlClient.MySqlException:
> Access denied for user: 'my-dash_username@%' to database
> '`my-dash_database`' ...
> 
> So i enclose the user name in `` also:
> Error connecting to the database!
> MySql.Data.MySqlClient.MySqlException:
> Access denied for user: '`my-dash_username`@my_IP' (Using password:
> YES) ...
> 
> 


For dashes in the name, you do need to enclose the database name in ``.  The
last two errors have nothing to do with dashes.  You simply have not granted
privileges to your username.  

Thread
Fw: Fw: Create a database programmatically from VB.NETJorge Bastos1 Feb
  • Trouble connecting to a database with a dash in its name (1.0.9)Carpe diem, d.o.o. Jure ┼ápik12 Feb
    • Re: Trouble connecting to a database with a dash in its name (1.0.9)Carpe diem, d.o.o. Jure ┼ápik12 Feb
    • RE: Trouble connecting to a database with a dash in its name (1.0.9)Reggie Burnett21 Feb