Showing entries 51 to 60 of 271
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: skysql (reset)
Common Errors and Resolutions for Building your own MySQL or MariaDB C/C++ Program on Windows

In my previous post, Creating a basic C/C++ Program to Interact with MySQL and MariaDB, I ran into some errors along the way, so I wanted to share those and their resolutions.

1. fatal error C1083: Cannot open include file: ‘mysql.h’: No such file or directory

mysql1.c
mysql1.c(2) : fatal error C1083: Cannot open include file: 'mysql.h':
No such file or directory

At this point, my cl command was:

cl /I "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"
mysql1.c

So I needed to include the directory that contained mysql.h as well. So the above changed to:

cl /I "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"
/I "C:\Program Files\MySQL\MySQL Server 5.5\include" mysql1.c

2. error C2061: syntax error : identifier ‘SOCKET’

This was actually a small slew of simple syntax errors. I …

[Read more]
Creating a basic C/C++ Program to Interact with MySQL and MariaDB

In this post, I’ll cover how to create a simple C/C++ program that interacts with MySQL using the C API (and Connector/C). I discussed in a previous post how to install the C Connector (both SkySQL and MySQL’s), so please refer to that if you are looking for more specifics on that.

So once you have that set up, then there are just a few more things you need to have in order – at least this was the case in my environment.

1. Create a program (this one simply connects to the server and retrieves the server version):

#include <stdio.h>
#include <windows.h>
#include <mysql.h>

MYSQL *conn;
int version = 1;

int main ( int argc, char *argv[] )
{
    conn = mysql_init ( NULL );
    mysql_real_connect ( conn, "localhost", "root",
            "password", "test", 3308, NULL, 0 );
        version = mysql_get_server_version( conn ); …
[Read more]
Setting Up Connector/C and SkySQL C Connector for MySQL and MariaDB

I’m writing a post on how to create your first C/C++ program for MySQL (using Windows, and from the command line). A prerequisite for that is to have a C Connector, such as MySQL Connector/C or SkySQL C Connector, so the program can communicate with mysqld.

I didn’t want that post to be too scattered, so I decided to split it into two, more focused posts. That said, this first post will focus on the Connector, and the next post will actually cover the program itself.

Installing and using Connector/C with MySQL is quite simple, so I wanted to show how easy it is. I also wanted to show examples with both SkySQL C Connector with MariaDB (which also works with MySQL) and Connector/C with MySQL, since both are widely used. I also wanted to show some common errors one might encounter and their resolutions, so hopefully this will help anyone who might have issues …

[Read more]
Resolving Error: master and slave have equal MySQL server UUIDs

If you’ve run into the following error, then there area couple quick fixes:

Errno: 1593
Fatal error: The slave I/O thread stops because master and slave
have equal MySQL server UUIDs; these UUIDs must be different for
replication to work.

To give some background first, starting in MySQL 5.6, the server generates a true UUID in addition to the –server-id supplied by the user. This is ultimately to help with new replication features.

From a under-the-hood view, when starting, the MySQL server automatically obtains a UUID as follows (per the manual):

  1. Attempt to read and use the UUID written in the file data_dir/auto.cnf (where data_dir is the server’s data directory); exit on success.
  2. Otherwise, generate a new UUID and save it to this file, creating the file if necessary.
[Read more]
Mitigating the Effect of Metadata Lock (MDL) Contention

If you see the “Waiting for table metadata lock” error, you may be wondering what is the best course of action to prevent it in the future. I have briefly discussed troubleshooting metadata locks before, however, that post more illustrated how easy it is to encounter the “Waiting for table metadata lock” error in both MyISAM and InnoDB. It provides simple examples for reproducing using both storage engines, so one could hopefully more easily identify where the locks are stemming from in their particular case.

Pin-pointing which transaction holds the locks is a different story. There are feature requests filed in MySQL and MariaDB bugs databases to track this information, but they are recent, and no ETA is scheduled for either yet, as far as I know:

http://bugs.mysql.com/bug.php?id=69527

[Read more]
Resolving Missing sys Include Files: devpoll.h, epoll.h, event.h, and queue.h during CMake when Building MySQL on Windows

As I mentioned in a previous post that I’d mention how I resolved some additional missing include files when building MySQL on Windows.

In this post I cover 4 missing header files, as they are all related and have to do with polling, and headers (and functions) from libevent, and in the folder /sys. I’m not sure if one should even use these functions from libevent on Windows, as these are not needed for Windows, and may not be beneficial either (that last part I’ve just read briefly about, so I’d need to that a bit more myself to be 100%), but including the headers won’t hurt, as it doesn’t hurt if they don’t exist.

At any rate, here were the 4 related missing header file warnings:

-- Looking for include file sys/devpoll.h
-- Looking for include file sys/devpoll.h - not found
-- Looking for include file sys/devpoll.h
-- Looking for include file …
[Read more]
Another Idea to Help Foster a Vibrant Community: Please make all bugs public

Since MySQL recently implemented the following feature request (and discussed here and here) to help foster communication among public bugs and feature requests, and to provide a way to allow the Community to voice whether or not a bug affects them, I decided to file another feature request that I think would even further encourage communication amongst an already vibrant community, and that is to simply:

“Please make all bugs public”

http://bugs.mysql.com/bug.php?id=69642

And thanks to the new bugs feature, if you would like to see this implemented as well, please click on the …

[Read more]
Resolving sasl/sasl.h Not Found during CMake when Building MySQL on Windows

When building MySQL (5.6 in this case) on Windows, if starting from a new/plain machine, there are some headers/libs/etc. missing that many distributions contain and/or are easy to add.

Resolving some of these, at least for me, have not always been intuitive on Windows. So I’m attempting to tackle them all and post the results to help others with the same issues. (I thought I’d fly through them all, and provide it all in a single post .. [insert laughs here] .. but that’s not gonna happen, so I’ll post them as I go. Might be better in the long run anyway for those searching for specific errors anyway.)

So this one is about the following, during the initial invocation of cmake:

-- Looking for include file sasl/sasl.h
-- Looking for include file sasl/sasl.h - not found

Thus I need to get sasl.h. SASL stands for “Simple Authentication and Security Layer”, which is a method for adding authentication …

[Read more]
Comprehensive How-To for Enabling the Standard InnoDB Plugin in MariaDB and MySQL

I’m always switching back-and-forth between the 2 different InnoDB flavors in MariaDB – XtraDB+ and the standard InnoDB plugin, so I thought I’d simply post all of the various combinations in a single place. (And then I cover enabling the InnoDB Plugin in MySQL, since it’s an option in 5.1.) [Addition: Thanks to Andrew and Sergei for the tips on shortening plugin-load=. The changes are reflected below.]

Note: Below is for Windows. For Linux, simply change “.dll” to “.so” where appropriate.

MariaDB 10.0:

Do not add anything, as the standard InnoDB plugin is the current default (as of 10.0.3, although I do anticipate this changing in the near future, and I’ll update the post accordingly when that happens).

MariaDB 5.5:

# Enable the 2 below to disable XtraDB+ and enable the standard InnoDB Plugin
ignore_builtin_innodb
plugin-load=ha_innodb.dll

[Read more]
Setting the TZ Environment Variable for MySQL on Windows

Most of us are familiar with how MySQL handles timezones, and what one must do to keep up with the latest changes, etc. Most of us use the system timezone info, which is great – one less item to update when changes occur (usually because of daylight savings changes). And for those who need more specifics, most everyone (except Windows and HP-UX) can update their timezone info using the zoneinfo database from the OS.

For those few Windows and HP-UX, you have to download the package of pre-built time zone tables that MySQL provides. Per the manual (timezone section):

“If your system is one that has no zoneinfo database (for example, Windows or HP-UX), you can use the package of pre-built time zone tables that is available for download at the MySQL Developer Zone:”

[Read more]
Showing entries 51 to 60 of 271
« 10 Newer Entries | 10 Older Entries »