Archive for the ‘windows’ Category

MySQL Connector/Net 6.4.5 has been released

Май 22nd, 2012
MySQL Connector/Net 6.4.5 has been released!  This is an update to our 6.4 driver and brings several bug fixes.  It is appropriate for production use with MySQL server versions 5.0-5.5

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.)

You can read about the changes in this version at http://dev.mysql.com/doc/refman/5.5/en/connector-net-news-6-4-5.html

You can find our team blog at http://blogs.oracle.com/MySQLOnWindows.  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

Mixed signals in IT’s great war over IP

Май 10th, 2012

Recent news that Microsoft and Barnes & Noble agreed to partner on the Nook e-reader line rather than keep fighting over intellectual property suggests the prospect of more settlement and fewer IP suits in the industry. However, the deal further obscures the blurry IP and patent landscape currently impacting both enterprise IT and consumer technology.

It is good to see settlement — something I’ve been calling for, while also warning against patent and IP aggression. However, this settlment comes from the one conflict in this ongoing war that was actually shedding some light on the matter, rather than further complicating it.

See the full article at TechNewsWorld.


PlanetMySQL Voting: Vote UP / Vote DOWN

Mixed signals in IT’s great war over IP

Май 10th, 2012

Recent news that Microsoft and Barnes & Noble agreed to partner on the Nook e-reader line rather than keep fighting over intellectual property suggests the prospect of more settlement and fewer IP suits in the industry. However, the deal further obscures the blurry IP and patent landscape currently impacting both enterprise IT and consumer technology.

It is good to see settlement — something I’ve been calling for, while also warning against patent and IP aggression. However, this settlment comes from the one conflict in this ongoing war that was actually shedding some light on the matter, rather than further complicating it.

See the full article at TechNewsWorld.


PlanetMySQL Voting: Vote UP / Vote DOWN

MySQL Connector/Net 6.3.9 has been released

Апрель 24th, 2012
MySQL Connector/Net 6.3.9, the latest maintenance release of our 6.3 version series, has been released.  Connector/Net is our all-managed .NET driver for MySQL.  This release will be the last release of our 6.3.x series and contains more than 25 fixes from the 6.3.8 base.  Users looking for additional fixes or features should upgrade to our most recent version.  You can see the list of changes and read more about the connector at http://dev.mysql.com/doc/refman/5.5/en/connector-net.html

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

It is now available in source and binary form from http://dev.mysql.com/downloads/connector/net/6.3.html#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.)

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

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

Screencast: Installing MariaDB on Windows

Март 21st, 2012

A screencast demonstrating the MariaDB Windows installer.

(I recommend watching it in full screen 720p, so you can see the details.)

Some links:

Acknowledgments:

A big thanks to Vladislav Vaintroub, MariaDB’s Windows guru, and to Rasmus Johansson for help with the screencast.


PlanetMySQL Voting: Vote UP / Vote DOWN

Recommendation: Vagrant and Veewee

Февраль 24th, 2012

Quoting from Vagrant’s web site:

Vagrant is a tool for building and distributing virtualized development environments. By providing automated creation and provisioning of virtual machines using Oracle’s VirtualBox, Vagrant provides the tools to create and configure lightweight, reproducible, and portable virtual environments.

A complementary technology called Veewee makes building VirtualBox VMs easier by automating away a lot of manual steps. Marius Ducea has a great blog post on how to use it.

My observations:
1. According to Vagrant’s web site, it should work on Windows. I’ve tried that with unsatisficatory results. I think it works better on Linux and Mac;
2. Vagrant 0.9 was released recently, and is the version that I am using. However, 0.9 broke some backward compatibility such that a lot of examples on Vagrant configuration file in its web site no longer works. But it does provide good cenough error message for you to fix and adjust;
3. Just a couple of weeks ago, Veewee was not compatible with Vagrant 0.9, but that has since been fixed. I mention this because things appear to be a bit fluid, and you may need to roll up your sleeves and tweak a few things yourself to get what you want;
4. Using Veewee to build Windows VM is not as smooth as doing the same for Linux VMs. In fact a few of the templates do not have the Cygwin setup file that definition.rb refers to. Another drawback is that the initial VM harddisk size is too small (10 gig I believe). Darn it, I forgot where I changed the setting to make it bigger before building it. Share that with me if you know please :)
5. In addition, it seems hard to build a Multi-VM environment with Windows in the mix. It looks possible, though. Once again please share that with me if you know!

Use cases:
1. Hacking, learning, and development. It provides a safe environment to play around, build and compile things, learn new technologies, etc. For example, I’ve used it to test and play with Tengine and Nginx. I’ve also built a Multi-VM environment where I tested MariaDB 5.3 and the new Percona Tools, pt-table-checksum and pt-table-sync in particular. I think Vagrant is a great tool to learn Chef, Puppet, and Hadoop;
2. Testing: testing software on different distros, continuous integration testing for server software (web server such as Tengine, database server such as MariaDB and Percona Server). In fact, using a Centos 6.2 VM, I found Percona’s 5.5 RPM packages still haven’t resolved header file conflicts, an old problem.

Sample Multi-VM Vagrant file
It is really convinient to have a Multi-VM environment for development and testing. Vagrant can do that but there is a shortage of good samples, especially for Vagrant 0.9. Here is a sample that worked for me. Note that:
1. The VMs in the environment can be made from the same image. In the sample below, “debian” and “xiaosaier”‘s daddy is “debian6″. No joke intended;
2. Use “vagrant ssh debian”, “vagrant ssh centos”, and “vagrant ssh xiaosaier” to get to each VM. Each VM can talk to each other via the IP address defined. Therefore it can be used for good, realistic testing. After having good Chef recipe or Puppet files, the VMs can be made in a certain way, which can be used for Continuous Integration Testing.
3. The hostonly network IP address works very well. However, the VM takes the name of the image it is based on by default. It will be nice to be able to customize the VMs’ names. Let me know if you know how;

Vagrant::Config.run do |config|

config.vm.define :debian do |debian_config|
debian_config.vm.box = "debian6"
debian_config.vm.network :hostonly, "33.33.33.10"
end

config.vm.define :centos do |centos_config|
centos_config.vm.box = "centos62"
centos_config.vm.network :hostonly, "33.33.33.11"
end

config.vm.define :x iaosaier do |xiaosaier_config|
xiaosaier_config.vm.box = "debian6"
xiaosaier_config.vm.network :hostonly, "33.33.33.12"
end

PS. Note, the combination of colon and letter x turns into an emotion icon in the web page. Watch out!


PlanetMySQL Voting: Vote UP / Vote DOWN

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