The user specified as a definer ('root'@'%') does not exist
I encountered this exception today while trying to read a data set from MySql database from C# .NET using MySql connector and enterprise library. Complete stack trace of this exception is below,
{MySql.Data.MySqlClient.MySqlException: The user specified as a definer ('root'@'%') does not exist
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)
at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoLoadDataSet(IDbCommand command, DataSet dataSet, String[] tableNames)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet(DbCommand command, DataSet dataSet, String[] tableNames)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.LoadDataSet(DbCommand command, DataSet dataSet, String tableName)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteDataSet(DbCommand command)
This happens when you try to make connection with MySql database from within .NET and is a privileges issues. For resolution, please follow these steps,
1- Run > Command Prompt
Move to C:\Program Files\MySql\bin folder. Path for me appears as following,
C:\Program Files\MySQL\MySQL Server 5.5\bin>
2- Log into My Sql by exeucting the following command,
mysql -u root -p
You will be prompted for password.
Enter password:
On successfull password input you will log into mySql console,
mysql> _
3- Grant All Privileges
Execute following command under my sql console,
grant all privileges on *.* to `root`@`%` identified by 'password';
Upon successfull completion of command you will recieve confirmation simialr to this,
Query OK, 0 rows affected (0.05 sec)
Note: Pay special heed to position of apostrophe vs. commas. Usernameis enclosed within apostrophy (`) where as password within commas (').
4- Flush Privileges
Execute following command to ensure the privileges take affect,
flush privileges;
which will result in notification similar to this,
Query OK, 0 rows affected (0.11 sec)
You are done. Switch back to Visual Studio to test your settings are properly taking affect. To exit mysql console type exit and press enter. Above steps are summarized in figure below,
Getting Started with Windows Phone 7 Development
Windows Phone 7 is to going to create hype in the market in coming days since recently collaboration between Nokia and Microsoft was made as a resultant of which Microsoft’s Windows Phone 7 operating system will be running on top of Nokia’s hardware. Also Windows Phone 7 allows development in .NET in a more controlled environment which is going to make the process of creating mobile phone apps as well as games a lot easier.
I am from Pakistan and I can tell you that out of every 10 mobile phone consumers, 7 are carrying Nokia sets with them. This powered by the fact that Nokia is to launch the Windows Phone 7 supported models in year 2011 and 2012 will bring a boost in developer market. Since there is a healthy competition already in the web development domain, it is encouraging for young developers to take a shift in paradigm and get hands on Windows Phone 7 development.
Keeping this under consideration, in this first tutorial I will take a look at setting up the environment for Windows Phone 7 development.
Note:
Before we begin please understand that there are two domains available for Windows Phone 7 development,
1- Silverlight based mobile applications development
2- XNA Game Studio based mobile games development
I will speak on each of these in more detail in a coming blog post.
Programming Language Barrier
Please note that C# is the recommended language for development of Windows Phone 7. VB .NET is supported for development of Silverlight based applications (using an extension kit Visual Basic CTP for Windows Phone Developer Tools to be installed after RTW package); there is no support currently for XNA Game Studio or Expression Blend for Windows 7 with VB .NET.
Pre-Requisite to Developer Tools
- One of the required tools (Visual Studio 2010 Express for Windows Phone) for windows phone 7 can’t be installed on Windows XP. You need to be at-least running on Windows Vista or preferably Windows 7. Trying to do so will stop installation with following prompt,
Contrary to that, XNA Game studio as a standalone package can be installed on Windows XP.- Please ensure you have Visual Studio 2010 installed. If you are running on top of Visual Studio 2008, upgrade to 2010 first before continuing.
Required Developer Tools
Next you need to have Windows Phone 7 RTW installed on your system. At the time of this writing you can get this from,
With Windows Phone 7 RTW you get a bunch of tools,
- Visual Studio 2010 Express for Windows Phone (Not required if already running on Visual Studio 2010 Professional or Ultimate)
- Windows Phone Emulator
- Silverlight for Windows Phone
- XNA 4.0 Game Studio
As mentioned above you might intend to install XNA Game Studio 4.0 alone. It is available as a stand along package at,
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=9ac86eca-206f-4274-97f2-ef6c8b1f478f
Review
|
Tool |
Purpose |
Separately Available |
Windows XP Support |
VB .NET support |
|
Visual Studio 2010 Express for Windows Phone |
Mobile Applications Development |
No |
No |
Yes |
|
Windows Phone Emulator |
No |
|||
|
Silverlight SDK for Windows Phone |
Yes |
|||
|
Expression Blend for Windows Phone |
Yes |
No |
||
|
XNA 4.0 Game Studio |
Mobile Games Development |
Yes |
Yes |
No |
Package for VB .NET can be found at,
Reference Reading: http://create.msdn.com/en-us/home/getting_started
EVDO network Interface is not listed by WireShark
Background Context
I am using EVDO broadband wireless Usb stick launched by Pakistan Telecommunication Limited (a 3.1 Mbps device). It is based on "CDMA2000" 3G wireless standard. It works well for me since I am at a rather lesser IT aware populated location. I came across an issue today while trying to capture network traffic on top of EVDO stick. I couldn't find much on this topic so I decided to write a post on this.
The Problem
I was able to get the network interface against EVDO using System.Net.NetworkInformation namespace,
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces()) { ... }
as following,
"WAN (PPP/SLIP) Interface"
However this interface was not listed at all by either WireShark or by SharpPCap (which I was using to get Network Devices list) so I wasn’t able to send/receive packets. I was running on,OS: Windows XP (x86)
with following,
WinPCap: 4.1.1
WireShark: Version 1.2.8 (SVN Rev 32676)
SharpPCap: SharpPcap-3.5.0
Solution
Since WAN (PPP/SLIP) interface is no exception I was forced to think that the issue is not due to usb modem but rather with WinPCap. I goggled it a bit and identified that PPP capturing is possible on Windows XP (x86) with WinPCap last stable release version (at the time of this writing) 3.1 which can be downloaded from,
http://www.winpcap.org/archive/3.1-WinPcap.exe
- I uninstalled 4.1.1 and reverted back to 3.1 and on the go, both network interfaces (Generic dialup adapter & WAN (PPP/SLIP interface) ) were listed relative to EVDO under WireShark and using SharpPCap (since it utilizes WinPCap).
Note: As per initial tests, I was able to capture traffic using Wireshark but while trying to open either of these interfaces using SharpPCap, I was getting an exception at device.Open(),
"Unable to open the adapter (rpcap://\Device\NPF_GenericDialupAdapter). Error opening adapter: The system cannot find the device specified. (20)"
OR
Unable to open the adapter (rpcap://\Device\NPF_{F9409E20-55C1-43AD-992A-10929B.....}). Error opening adapter: The system cannot find the device specified. (20)
However since this post is primarily relative to listing of interfaces, the resolution was found. I will speak more on the issue of communication with EVDO device using SharpPCap in another blog post.
References
More details on the topic of PPP capturing can be found at,


