Archive for the ‘windows’ Category

MySQL Connector/Net 6.5.1 beta has been released

Январь 26th, 2012
MySQL Connector/Net 6.5.1, a new version of the all-managed .NET driver for MySQL has been released.  This is a beta release of our newest connector and comes with several new features.  It is of beta quality and should not be used in any production environment.  It is appropriate for use with MySQL server versions 5.0-5.6

It is now available in source and binary form from http://dev.mysql.com/downloads/connector/net/#downloads and mirror sites (note that not all mirror sites may be up to date at this point-if you can't find this version on some mirror, please try again later or choose another download site.)

This new versions brings new features such as
  • Exception and command injector support
  • Millseconds support
  • Better partial-trust support
  • Better intellisense including auto-completion when editing stored procedures or .mysql files
These features are not yet documented in the shipping documentation.  We have posted a series of posts to our blog outlining these new features.

You can leave comments here on the blog post or post questions on our forums at http://forums.mysql.com/

Enjoy and thanks for the support!      
PlanetMySQL Voting: Vote UP / Vote DOWN

Running Connector/Net 6.5 inside Medium-Trust Level

Январь 3rd, 2012

As you probably know, there were some problems using our connector in medium-trust level scenarios. Most hosting services provide MySQL access.  Most of these hosting providers run their .NET web apps using medium trust.  Prior to 6.5, our connector required the hosting provider to either run the application in full trust or to enable broad privileges like SocketPermission globally.  Many hosting providers are unwilling to do that.  So fully enabling our provider to run in a partial trust scenario was a strongly requested feature. The request was a very simple task: enable Connector/Net to work correctly in a medium-trust level environment when the library is installed in the GAC.

The implementation consisted of including the necessary security imperative asserts so the CLR allows our code to perform the operations where it needs permission to perform.

The permissions that we needed were:

- System.Net.SocketPermission

- System.Security.Permissions.ReflectionPermission

- System.Net.DnsPermission 

- System.Security.Permissions.SecurityPermission 

Starting from 6.5 you can use the Connector/Net library inside any medium-trust level environment with out any issue.  You should note that the hosting provider will need to install our library in the GAC however they can avoid granting permissions globally by using the new MySqlClientPermission class in the trust policies.

Let's put some code together to see it working.

For this little application you need to have  MySQL server up an running and enable it to use pipe connections. To do so you need to add the -enable-named-pipe option on the command line. (If you need more information about this please see http://dev.mysql.com/doc/refman/5.5/en/windows-installation.html).

 1 - Create a simple web application using VS 2010

 2 - Add the reference in your application for our library. 

 3 - Edit your web.config file so your application run using a Medium trust level.

<system.web>

    <trust level="Medium"/>

 </system.web>

 4.  Add the MySql.Data.MySqlClient namespace to your server-code page.

 5. Define the connection string:

MySqlConnectionStringBuilder myconnString = new MySqlConnectionStringBuilder("server=localhost;User Id=root;database=test;"   );

          myconnString.PipeName = "MySQL55";

          myconnString.ConnectionProtocol = MySqlConnectionProtocol.Pipe;

6. Define the MySqlConnection to use:

          MySqlConnection myconn = new MySqlConnection(myconnString.ConnectionString);

          myconn.Open();

7. Retrieve some data from your tables: 

MySqlCommand cmd = new MySqlCommand("Select * from products", myconn);

MySqlDataAdapter da = new MySqlDataAdapter(cmd);

DataSet1 tds = new DataSet1();

da.Fill(tds, tds.Tables[0].TableName);

GridView1.DataSource = tds;

GridView1.DataBind();

myconn.Close()

 8. Execute!!

Noticed that you don't need to add any special code so your application can run properly inside Medium-Trust. 

Now you should be able to see your application running with out any security problems.

Please feel free to ask all your questions related to this new feature or ask for more information if you need so.

I hope you have found this information useful. 

Happy MySQL/Net Codding! :)

Some useful references related:

Connection to MySql Server  (http://dev.mysql.com/doc/refman/5.1/en/connecting.html)

Windows Authentication (http://blogs.oracle.com/mysql_wna_plugin/entry/windows_native_authentication_for_mysql)


PlanetMySQL Voting: Vote UP / Vote DOWN

Using MySqlClientPermission Class on Connector/Net 6.5 to restrict data access

Январь 3rd, 2012

We have a new feature as part of the 6.5 release. There is a new class that you can use to restrict access to specific connection strings that you want to use in all the connections in applications that use MySQL databases.

The following example shows how you can use the MySQLClientPermission class to restrict access to a specific server name and a database, while allowing any value for the User Id and Password within the connection string:

MySqlClientPermission permission = new MySqlClientPermission(PermissionState.None);

permission.Add("server=localhost;database=test;", " user id=; password=;",

KeyRestrictionBehavior.AllowOnly);

permission.PermitOnly();

MySqlConnection myconn = new MySqlConnection();

myconn.ConnectionString = "server=localhost; user id=QueryUser; database=test;";

myconn.Open();  // Attempt to use the connection string

The first line of code creates a new instance of the MySqlClientPermission class. Notice the value on the constructor method that restricts all connections strings.  Then you must add the connection strings that you want to allow by calling the Add method, as seen on the second line. The first argument should be the set of connections strings that you want to permit in a list with all the required keys and values.

For this case we're defining the server name and database name. All the connections must have these specified values in order to pass the security check. The second argument is a semi-colon delimited list of all the optional attributes. All the connection strings can have any value for these attributes to pass the security check. The third and final argument controls whether you're granting or denying permission for the connection strings that match this pattern. 

If the connection string that you use after this security definition does not match all the requirements, the attempt to do the connection will throw a SecurityException before even attempting to connect to the specified database.

The MySqlClientPermission instance can have multiple connections and any call to MySqlConnection.Open will not succeed if the connection string fails at least one of those checks.

It is always a good practice that you start by restricting all permissions and then allow the specific access your application requires.

Happy MySql/Net Codding!! 



PlanetMySQL Voting: Vote UP / Vote DOWN

Intellisense Support

Январь 3rd, 2012

 Intellisense Support in Visual Studio

One of the cool features coming in Connector/NET 6.5 is the support in Visual Studio 2010 of Intellisense for MySql files.

As you probably know, the capability of editing mysql files (in the way of both .mysql raw files included in the solution and stored procedures/functions from Server Explorer) has been around for a while, yet a missing piece of the puzzle was to have advanced completion of sql statements in those files… until now.

Let’s explore the set of features currently implemented as part of Intellisense support.

Note: For completion intellisense features to work a database connection must be properly configured, see images below


For Server Explorer items, the connection is the root of the elements.
For .mysql files, the connection is individually configured using the Connect to MySql toolbar button.

Also to trigger the completion features you just either use the standard Visual Studio shortcut “Control+J” or start typing the name of an object. Both ways to trigger intellisense work in all syntactical contexts.

a) Table Completion

Table completion means showing the list of tables for the current connection database in the proper syntactical context. Basically this means any part of a sql sentence where the parser expects a table. Some examples of this feature follow:

After the “from” clause in a select, you can press Control+J and get a list of all the tables from the current connection database.
After selecting one of the options, the text appears wrapped in quotes (to cover the case when the table name has whitespaces or is a mysql reserved word).
Or you can start typing the name of a table, and the list shows only those items that match.
Another example, after an inner join.
Another example, in an update statement. Also notice that you can have several sentences on the file, but the previous sentences must be correct syntactically (included being finished with a semicolon).
Another example, on the insert statement.
As expected, combinations like insert into select, also work.
Table completion for a delete statement.
For show create table statements.
For truncate statements.

And of course there are many others.

b) Column Completion

Column completion means showing the list of columns for the current connection database table or tables in the proper syntactical context. Basically this means any part of a sql sentence where the parser expects a column. Some examples of this feature follow:

After a select without from clause you can get, by Control+J, the list of columns for all tables in the current database.
If you type c, the lists shown filters out items whose name doesn’t start with the characters typed.
Things get more interesting when there is a context restricting the tables to use, like here, after the “*, “.
What if you add the same table several times with different alias? Then the list of columns is prefixed with the alias name, not the table name. Also works in where clauses.
“Set” clause in Update statements.
“Order by” clauses.
“On” clause in a left join select statement.
Column completion on insert into statements.

And other cases not showed here.

If you want to see Intellisense within a stored procedure definition, the rest of the stored procedure (excluding the sentence currently being edited) must be syntactically correct.

c) Stored procedure name Completion

Stored procedure name completion means showing the list of stored procedures in the proper syntactical context.

For the call statement, you get the list of stored procedures; notice that when you highlight one, its signature appears as a tooltip.

For those of you interested in compiler technology, behind the scenes these intellisense features are powered by an ANTLR generated parser, this parser will also be the foundation for other interesting features…

Anyway, let us know what you think, if there are other things you want to see on Intellisense support or in the Connector/NET in general. (Or you can open a bug / feature request at http://bugs.mysql.com, Connector/NET category).


PlanetMySQL Voting: Vote UP / Vote DOWN

2011, A great year for MySQL in review…

Декабрь 29th, 2011
I see so many posts on what happened to company X, product Y and dream Z that I couldn't resist the temptation to summarize this great year for MySQL. At the end of 2010, Oracle did an announcement we were all waiting for: MySQL 5.5 is GA! Another year has passed since then and it's time to reflect on what has been done.

I know this is a long post. I tried to rewrite it at least 10 times to make it shorter, but I couldn't condense the list. Hence, I wrote a summary in the beginning for those who don't want to read it all.

I believe that 2011 was an exceptional year for MySQL and I really enjoy being part of this team. I wish all of us a lot of success and fun in the years to come!

Summary:
Oracle released many MySQL 5.6 and MySQL Cluster 7.2 DMRs accompanied by new versions of MySQL Enterprise Monitor, MySQL Enterprise BackupMySQL Workbench (and utilities), MySQL Proxy, MySQL Cluster Manager and Connectors.

The MySQL team unveiled new products like the MySQL Installer for Windows and Oracle VM Templates for MySQL. Besides, the MySQL Enterprise offering has been enriched with new commercial extensions. MySQL can now be leveraged as one of the Oracle data management solutions with new certifications and the integration with My Oracle Support increased the business value of customers' investment on Oracle technologies.

Additionally MySQL presented at mayor events across the world and won a few awards.


Long List:
If you're still reading, below you can find an hopefully-extensive list of announcements and blogs (in reverse chronological order). I've mainly covered product releases, events and awards. Please let me know if I missed something.

Products: 
Dec 26 - MySQL Workbench 5.2.37 Has Been Released
Dec 20 - MySQL 5.6.4 Development Milestone Now Available!
Dec 02 - MySQL Enterprise Monitor 2.3.8 is now GA!
Nov 28 - MySQL 5.5.18 Debian packaging now available
Oct 10 - New MySQL Enterprise Oracle Certifications
Oct 10 - MySQL Utilities 1.0.3
Oct 07 - MySQL Cluster 7.2 (DMR2): NoSQL, Key/Value, Memcached
Oct 03 - More Early Access Features in the MySQL 5.6.3 Development Milestone!
Oct 03 - New Development Milestone Releases & Certifications!
Sep 15 - New Commercial Extensions for MySQL Enterprise Editions
Sep 09 - MySQL@Oracle OpenWorld
Sep 06 - Oracle Enhances MySQL Installer and High Availability for Windows
Sep 06 - Oracle Enhances MySQL Manageability on Windows
Aug 19 - MySQL Proxy 0.8.2 Has Been Released
Aug 01 - More New MySQL 5.6 Early Access Features
Jul 19 - MySQL Enterprise Backup 3.6 - New backup streaming, integration with Oracle Secure Backup and other common backup media solutions
Jul 18 - Simpler and Safer Clustering: MySQL Cluster Manager Update
Jul 06 - Announced Oracle VM Templates for MySQL
Apr 12 - MySQL Cluster 7.2 Development Milestone Release - NoSQL with Memcached and 20x Higher JOIN Performance
Apr 11 - Top Features in MySQL 5.6.2 Development Milestone Release
Apr 11 - Introducing the MySQL Installer for Windows
Mar 15 - Oracle Enhances MySQL Enterprise Edition

Events:
Oct 26 - A lot of MySQL Events in Europe
Oct 12 - MySQL Roadshow in Germany
Sep 16 - OTN MySQL Developer Day in London
Aug 08 - OTN Developer Day: MySQL is Coming to Washington, DC
Jul 14 - New “Meet The MySQL Experts” Podcast Series
May 13 - Upcoming MySQL Events in Europe
Apr 26 - OTN Developer Day for MySQL - Santa Clara, CA
Mar 25 - MySQL (and Cluster) at Collaborate and O'Reilly MySQL Conference
Mar 14 - First Ever MySQL on Windows Online Forum - March 16, 2011

Awards:
Dec 15 - MySQL Wins Best Open Source Product of 2011 Award
Jun 03 - MySQL Wins the php|architect Impact Award for Data Management
Jan 17 - MySQL Makes the Cover of Oracle Magazine

To all MySQL customers, partners, colleagues, developers, users, advocates or aficionados: Thank you for this terrific year! Go MySQL!



PlanetMySQL Voting: Vote UP / Vote DOWN

MySQL Connector/Net 6.5.0 beta has been released

Декабрь 23rd, 2011
MySQL Connector/Net 6.5.0, a new version of the all-managed .NET driver for MySQL has been released.  This is a beta release of our newest connector and comes with several new features.  It is of beta quality and should not be used in any production environment.  It is appropriate for use with MySQL server versions 5.0-5.6

It is now available in source and binary form from here and mirror sites (note that not all mirror sites may be up to date at this point-if you can't find this version on some mirror, please try again later or choose another download site.)

This new versions brings new features such as
  • Exception and command injector support
  • Millseconds support
  • Better partial-trust support
  • Better intellisense including auto-completion when editing stored procedures or .mysql files
These features are not yet documented in the shipping documentation.  We will be posting a series of posts to our blog outlining these new features and will have them fully documented by GA.

You can leave comments here on this blog or you can also post questions on our forums at http://forums.mysql.com/

Enjoy and thanks for the support! 
PlanetMySQL Voting: Vote UP / Vote DOWN

Introducing the team!

Декабрь 22nd, 2011

When Oracle acquired MySQL there was some concern about what would happen with the world's most popular open-source database.  It's clear now that not only is Oracle very serious about continuing the great database but it is expanding the teams working on it and it's related technologies.  I know because I run one of those teams!

I've been working on MySQL and .NET technologies for the past 8 years and I'm very proud to introduce a couple of people who have been and will continue be working on my team.  

Fernando Gonzalez currently serves as leader of our Connector/Net team and has just completed some early work on major intellisense improvements on Connector/Net 6.5.  He's done work on developing a new parser for our product.  We look forward to Fernando being a team leader and productive member of our team!

Gabriella Martinez has been working with Fernando on 6.5 and recently completed work on several new features including new milliseconds support and better support for partial trust scenarios. Gabriella will soon be moving to a new project that we look forward to announcing in the near future. Gabriella has already proven to be a very effective developer and important addition to the team.

We have 3 more developers starting on Jan 2 and I can't wait to write a followup to this post introducing those guys.  We are expanding our team and doing some great things with MySQL, Windows, and .NET.  2011 has been a very good year and we look forward to 2012 being even better!

Merry Christmas and Happy New Year! 


PlanetMySQL Voting: Vote UP / Vote DOWN

MySQL Connector/Net 6.3.8 has been released

Декабрь 22nd, 2011
MySQL Connector/Net 6.3.8, a new version of the all-managed .NET driver for MySQL has been released.  This is a maintenance release to our 6.3 release chain and includes 40 changes and fixes.

Version 6.3.8 is appropriate for use with versions of MySQL 5.0-5.5.

It is now available in source and binary form from here and mirror sites (note that not all mirror sites may be up to date at this point-if you can't find this version on some mirror, please try again later or choose another download site.)

The release is also available for download on My Oracle Support (MOS).

Enjoy and thanks for the support!
PlanetMySQL Voting: Vote UP / Vote DOWN

MySQL HA Solutions – webinar replay

Декабрь 7th, 2011

If you were unable to attend the live webinar (or you want to go back and listen to it again) then it’s now available to view on-line here.

Databases are the center of today’s web and enterprise applications, storing and protecting an organization’s most valuable assets and supporting business-critical applications. Just minutes of downtime can result in significant lost revenue and dissatisfied customers. Ensuring database highly availability is therefore a top priority for any organization. Tune into this webcast to learn more.

The session discusses:

  1. Causes, effect and impact of downtime
  2. Methodologies to map applications to HA solution
  3. Overview of MySQL HA solutions
  4. Operational best practices to ensure business continuity

PlanetMySQL Voting: Vote UP / Vote DOWN

Announcing new features in MariaDB

Декабрь 2nd, 2011

We have lately been talking about some upcoming features that we feel are important to MariaDB users, because the corresponding ones that will be provided with MySQL will be incompatible with MariaDB and closed source.

We’re happy to announce the following:

  • The next version of MariaDB, version 5.2.10 will include an open source PAM Authentication Plugin. MariaDB 5.2.10 is scheduled for release next week.
  • A Windows Authentication Plugin is in development and QA currently and will be part of MariaDB 5.2.11, which is scheduled for release before Christmas.
  • MariaDB 5.5 will include both of the above plugins and an open source thread pool implementation. The soon-to-be-launched first version however will not include the thread pool.

Stay tuned for more information as soon as we start launching the above features.

Mission critical services relying on MariaDB should be aware that SkySQL has familiarized themselves with the new features and are ready to support all of the above options.


PlanetMySQL Voting: Vote UP / Vote DOWN