Pages

Search This Blog

Tuesday, May 19, 2009

MySql.Data.MySqlClient.MySqlException: Table 'xxx.xx_XxxxXxx' doesn't exist

Hit error when try to connect to MySQL in Linux from ASP.NET in IIS6. Seriously, the table is 100% Exist in the database but i hit error below:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: MySql.Data.MySqlClient.MySqlException: Table 'xxx. xx_XxxxXxx' doesn't exist




Well, finally find out that it caused by case sensitive on the table name. After i've change the name, it's work perfectly.


Monday, May 18, 2009

Access denied for user 'xxxx'@'xxx.xxx.xxx.xxx' (using password: YES)

Well, my scenario is connecting my ASP.NET 2.0 apps from IIS6 (window 2003 server) to MySQL (Linux) using ADO.NET Connector.

Hit error message when try to connect:
Access denied for user 'userxxx'@'xxx.xxx.xxx.xxx' (using password: YES)



It's quite worry because this is first time trying to connect from a .net web application is IIS to MySQL in Linux.

Prior to that, privileges must be granted in MySQL.
______________________________________________
mysql> grant all privileges on *.* to 'userxxx'@'xxx.xxx.xxx.xxx'
identified by 'xxxpasswordxxx' with grant option;
Query OK, 0 rows affected (0.00 sec)
______________________________________________

Finally, found that it's my own mistake. I've put in the wrong username and password. Check your username and password seriously before the connection.

Saturday, May 16, 2009

Add more than one column to a table in MySQL

Sometimes we might need to add multiple column to a table in MySQL, sample below work perfectly

ALTER TABLE pp_batch_detail
ADD `user_id` int(10) unsigned default NULL,
ADD `user_name` varchar(255) default NULL,
ADD `date_request` datetime default NULL;