Deploying a MySQL application

2012-07-02 Thread Miguel Cardenas
Hello After days of tests with different configurations for my VC++ project, finally I was able to run it using both Release and Debug versions with MySQL... now I have a few doubts on the application deployment... 1. The library was linked DINAMICALLY (DLL) since I want the MySQL code independen

Unhandled exception at 0x51716970 in MSQ.exe: 0xC0000005: Access violation reading location 0x00000000.

2012-06-30 Thread Miguel Cardenas
Hello I have a simple application that uses MySQL C API that works fine in release mode, but when run in debug mode it crashes: Unhandled exception at 0x51716970 in MSQ.exe: 0xC005: Access violation reading location 0x. and don't know what can be the problem. The application was bui

Re: Unresolved symbols with mysqlclient in DEBUG mode using VC++ 2010 Express

2012-06-19 Thread Miguel Cardenas
"...\mysql\lib\debug" in DEBUG mode... maybe running the debugger will not work with the lib, still have to test, but at least it compiles with no errors... can you comment something about this? On Tue, Jun 19, 2012 at 2:24 PM, Lars Nilsson wrote: > On Tue, Jun 19, 2012

Unresolved symbols with mysqlclient in DEBUG mode using VC++ 2010 Express

2012-06-18 Thread Miguel Cardenas
Hello friends I'm back to MySQL programming using the C API... it works fine when I compile using the RELEASE mode and "C:\Program Files (x86)\MySQL\MySQL Server 5.5\lib" but if I choose the DEBUG mode and "C:\Program Files (x86)\MySQL\MySQL Server 5.5\lib\debug" it fails at link time: 1>mysqlcli

Emergency backup from *.frm *.MYD *.MYI files

2012-06-08 Thread Miguel Cardenas
Hello My linux system died due a bad system driver and it does not boot ANYMORE, I am backing up my data files to restore a previous worlking backup of the whole system that DOES NOT INCLUDE THE DATABASES... I'm still backing up and will take some time before restore the system, in the mean time

Uninstalling MySQL 6.x from Windows

2010-06-29 Thread Miguel Cardenas
Hello I have an old windows installation with MySQL 6.x and want to remove it so I can install latest version 5.1.48 but I tried once before with another computer and newer installation never worked, had to reinstall whole windows to make a new clean installation. How can I remove completely vers

MySQL application & development LIBS

2010-02-13 Thread Miguel Cardenas
Hello I have a small Windows application linked to the MySQL development libraries and have to run in on another computer, do I have to copy the DLL/LIB files or are they already static linked to the application? The other computer has no MySQL installed, and the application will run only as clien

LIMIT/OFFSET to paginate results

2009-11-23 Thread Miguel Cardenas
Hello list :) I am developing an application that will show records in paginated documents, i.e. 10 records per page Lets supose this row structure MyTable ID(autoincrement) SectionID Name Description The ID is automatic autoincrement for unique records, the SectionID is to separate items

Removing MySQL to install new version

2009-11-12 Thread Miguel Cardenas
Hello I noticed that mysql 6 alpha is no longer available so I want to remove it from my laptop and install the latest 5.x version. I have just restored my Linux system image so my database is clean and empty and is a good moment to do it. My question is, how can I remove it completely from my di

Linking mysqlclient to a windows program

2009-03-11 Thread Miguel Cardenas
Hello I have configured my VC++ to link my programs with mysqlclient, but now am trying a program with Qt that is compiled using "make" from the command line, is it enough to add "mysqlclient.lib" to my makefile library configuration? I mean, is it enough to add the path to the header files and my

Re: VC++ 2008 / MySQL debug / Unhandled exception

2009-01-14 Thread Miguel Cardenas
Hi I'm using /MT (LIBCMT.lib?) and it is multi-threaded since all my multi-thread code is working. LIBCMTD.lib is ignored because it is indicated in a post at MySQL forums " http://forums.mysql.com/read.php?45,49606,49606#msg-49606"; and anyway applications do not compile if not ignored because lo

Re: VC++ 2008 / MySQL debug / Unhandled exception

2009-01-14 Thread Miguel Cardenas
eem to recall the issue with the debug library, but don't recall the > fix. Do you get the same permissions (access) error with the release > library? > Pat... > > - Original Message - From: "Miguel Cardenas" > To: > Sent: Saturday, January 10, 2009 10:2

VC++ 2008 / MySQL debug / Unhandled exception

2009-01-10 Thread Miguel Cardenas
Hello list I have a problem debugging a program that uses MySQL. The program itself does not have problems, it runs perfectly when run in the console (command prompt), but if it is executed inside the Visual C++ 2008 debugger it causes an error: Unhandled exception at 0x004b1560 in MyProgram.exe:

MySQL programming from *NIX to Windows

2008-12-14 Thread Miguel Cardenas
Hi list I am porting a *NIX MySQL application from Linux to Windows, it uses the C API (header files and libraries) that comes with the distribution package. My program is already working on Windows and just have to add the last part that is the MySQL support but have two doubts: The Windows zip/

BACKUP DATABASE * TO '/tmp/all.backup'; - DOES NOT WORK (6.0.4-alpha)

2008-06-26 Thread Miguel Cardenas
Hello Hello I have troubles with 'BACKUP DATABASE', I thought it was problem of syntax, but have tried even the samples in http://dev.mysql.com/doc/refman/6.0/en/backup-database.html and the command is not recognized $ mysql --version mysql Ver 14.14 Distrib 6.0.4-alpha, for pc-linux-gnu (i686)

MySQL 6.0.4: 'RESTORE TABLE' *nor* 'RESTORE DATABASE' available

2008-06-26 Thread Miguel Cardenas
Hi I've just reinstalled my system and used the oportunity to get the latest MySQL, so I got 6.0.4 version and installed it. The problem is that want to restore some tables but 'RESTORE TABLE' nor 'RESTORE DATABASE' (as specified in the manual online) are not available, 'BACKUP xxx' are neither a

Selecting rows by DATE ranges

2007-06-23 Thread Miguel Cardenas
Hello list I found a little problem with an application am developing, in particular creating reports by DATE ranges. Examples: select ... where date>"2007-01-01"; returns all records where date is greater (and equal inclusive) to 2007-01-01 select ... where date>="2007-01-01"; returns all rec

Avoiding TIMESTAMP

2007-05-26 Thread Miguel Cardenas
Hello list I need to solve a little problem but don't mind how, maybe you could suggest something. I have a database which registers payments, records have a AUTO_INCREMENT field to assign a unique consecutive number associated to every payment, some other fields that store the amount, type of

Re: Problem with GRANT ... 'user'@'%'

2007-05-21 Thread Miguel Cardenas
> Hm, I didn't know that! I thought it was only a special value to the > client tools, which I know will try to connect via socket on UNIX machines > when they see 'localhost' but will try to connect via TCP/IP when they see > '127.0.0.1'. Thanks for pointing this out! > > Baron In fact that was

Re: Problem with GRANT ... 'user'@'%'

2007-05-21 Thread Miguel Cardenas
> Localhost is indeed a special value that isn't include in '%'. It's a > feature not a bug ;) > > Regards, Bingo! That was the point! If i connect to the server ip or server name it works perfectly, but if I try to connect to localhost it fails unless I add a new user specific to localhost :D

Re: Problem with GRANT ... 'user'@'%'

2007-05-21 Thread Miguel Cardenas
> If you don't specify a hostname in SHOW GRANTS, '%' is assumed. My mistake > for not telling you this before. If you enable networking, and connect > with > > mysql -h 127.0.0.1 > > instead of > > mysql -h localhost Well, in fact 127.0.0.1 and localhost produce the same effect but

Re: Problem with GRANT ... 'user'@'%'

2007-05-20 Thread Miguel Cardenas
> Remember to quote the user and host carefully. So, The quoting is okay, I tested again > If you have doubts about what you actually granted, do this: > SHOW GRANTS FOR 'user' I've sent this command: grant all on mydatabase.* to 'myuser'@'%' identified by 'mypass'; Then tested the show grants

Problem with GRANT ... 'user'@'%'

2007-05-19 Thread Miguel Cardenas
Hello list I have a problem adding a user with host '%' ... *** If I add a user with host '%' when trying to connect get this error: ERROR 1045 (28000): Access denied for user 'myuser'@'localhost' (using password: YES) *** If I add the same user with localhost it connects and works fine... My

Compiling mysql-5.0.18 under solaris 10

2006-02-07 Thread Miguel Cardenas
Hello Am trying to compile mysql-5.0.18 under solaris 10 but get the following error Making all in zlib make[2]: Entering directory `/tmp/mysql-5.0.18/zlib' /bin/bash ../libtool --preserve-dup-deps --mode=link gcc -O3 -DDBUG_OFF -DHAVE_RWLOCK_T -o libz.la -rpath /usr/local/mysql/lib/mysql -ver

User/Password for every host?

2005-10-01 Thread Miguel Cardenas
Hello list I have a doubt... Do I need to set a password to a user for each host the user has permission to connect from? Let's supose // add user 'somebody' GRANT ALL PRIVILEGES ON *.* TO somebody@"192.168.0.%" IDENTIFIED BY 'onepass'; if I want 'somebody' to have access from "dsl-A.B.C.D-pro

ADDING ALLOWED HOSTS

2005-09-25 Thread Miguel Cardenas
Hello I've just read the users management, it is pretty clear but have a technical doubt... I have a server at the office and want to work on it from home sometimes. It has not a fixed ip, is ADSL and address changes from time to time. Am able to access the server via ssh by using a domain ove

Creating HUGE reports

2005-09-24 Thread Miguel Cardenas
Hello... After solving some problems with the code, now am working with the real one database. On my tests was playing with 20,000 records and worked pretty fine sorting by X or Y field and setting some 'where ...' conditions. At this moment the database has 250,000+ records, new insertions are

myhostname-bin.000nn @ /usr/local/mysql/var

2005-09-24 Thread Miguel Cardenas
Hello list I wanted to know how much space was using the database am working on, but found some big files I don't know what they do... these files are located in /usr/local/mysql/var and are named 'myhostname-bin.000nn' (nn is 1 to 29 at this moment)... I don't know that are those files, so

Re: mysql_free_result() & 2 different connections

2005-09-21 Thread Miguel Cardenas
> 4.1.4 is beta version, isn't it ? I'll suggest you try the latest > binary for 4.1 available for your setup. Oops, sorry, type mismatch error... I mean 4.1.14, the most recent > > I suspect that the current version of MySQL frees the resources > > automatically, > no, it does not :-) I tho

Re: mysql_free_result() & 2 different connections

2005-09-20 Thread Miguel Cardenas
> Are your two tables in the same database ? > If yes only one connection if enough, and you could use a join query > to do it, thus having a speed improvement of several magnitudes. I've just downloaded another 2 mysql manuals and have been sit on my chair all day reading them, but still do not

Re: mysql_free_result() & 2 different connections

2005-09-20 Thread Miguel Cardenas
> > I have 2 different result sets, since are two different connections to > > the server, simultaneous but independent (two handles, two connections, > > two different queries) > > what is the code you're using ? in a very small representation the program is this *** dbmail and dbmail2 open 2 di

Re: mysql_free_result() & 2 different connections

2005-09-19 Thread Miguel Cardenas
Hello I was re-reading last mails, analized it carefull again and... > > while ( my1.fetch ) { > >    my2.query + my2.store > >    if ( my2.fetch ) { > >       report = my1 + my2 results > >    } else { > >       report = my1 > >    } > >    my2.FreeResult <--- free for every my2.query inside loo

Re: mysql_free_result() WITHOUT mysql_fetch_row()

2005-09-19 Thread Miguel Cardenas
Hello > Have you try : > select count(*) from mytable where id=x and list=something > if count ==0, it's like fetchrow==NULL from your solution, but without > all the fuss about use_result(); No, but looks fine, I didn't know this usage of count(*) combined with conditions, but now will use it :

mysql_free_result() CRASHES

2005-09-18 Thread Miguel Cardenas
Hello I've just experienced troubles with mysql_free_result() but don't know what is wrong... one of my programs has 2 simultaneous connections to MySQL and crashed when doing the mysql_free_result(), I thought it was 'cos the way I was making the program, but now I have the problem with single

Re: mysql_free_result() WITHOUT mysql_fetch_row()

2005-09-18 Thread Miguel Cardenas
> http://dev.mysql.com/doc/mysql/en/mysql-free-result.html > it does not says : you have to retrieve all rows before freing it. So > you should be able to free the result. Otherwise it's a bug or > undocumented behaviour. > But why don't you use the Count(*) solution ?? that's exactly what you > ne

mysql_free_result() --- PART II

2005-09-17 Thread Miguel Cardenas
Hello again Sorry, this is the third mail but found something strange... In the past mail commented about the following error: *** glibc detected *** double free or corruption (!prev): 0x08051d58 *** Aborted but found that mysql_free_result() produces this error only when ALL data has been ret

Re: mysql_free_result() WITHOUT mysql_fetch_row()

2005-09-17 Thread Miguel Cardenas
> In the last episode (Sep 17), Miguel Cardenas said: > > I have a technical doubt, very simple but not mentioned in the manual... > > > > What happens if I call mysql_free_result() after performing a query > > but without doing mysql_fetch_row() ??? > > > >

mysql_free_result() & 2 different connections

2005-09-17 Thread Miguel Cardenas
Hello list There is another doubt... I have programmed a C++ object that connects to MySQL, it has encapsulated its own MYSQL *mysql MYSQL_RES *result ... etc etc data, so it it possible to have several simultaneous connections to MySQL performing different jobs, but I have experienced a stran

mysql_free_result() WITHOUT mysql_fetch_row()

2005-09-17 Thread Miguel Cardenas
Hello list I have a technical doubt, very simple but not mentioned in the manual... What happens if I call mysql_free_result() after performing a query but without doing mysql_fetch_row() ??? It may sound strange, but just need to know if a data row exists more than the data itself... The rig

MySQL 4.0.14 & mysql_create_db()... II

2003-08-14 Thread Miguel Cardenas
Hello again... I opened mysql.h and found this... --- #ifdef USE_OLD_FUNCTIONS MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd); int STDCALL mysql_create_db(MYSQL *

Re: MySQL 4.0.14 & mysql_create_db(), mysql_drop_db()

2003-08-14 Thread Miguel Cardenas
Hello > #ifdef USE_OLD_FUNCTIONS > MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, >const char *user, const char > *passwd); int STDCALL mysql_create_db(MYSQL *mysql, const char > *DB); int STDCALL mysql_drop_db(

`mysql_config --...` does not work

2003-08-14 Thread Miguel Cardenas
Hello list For some strange reason `mysql_config --...` does not work. If try something like gcc -o progname `mysql_config --cflags` progname.c `mysql_config --libs` (NOTE: "/usr/local/mysql/bin" is in the PATH var, mysql_config works when invoked) the compiler does not find the header files

MySQL 4.0.14 & mysql_create_db(), mysql_drop_db()

2003-08-14 Thread Miguel Cardenas
Hello list... Am developing an application with mysql support and it works fine, but today changed from 3.23 (deinstalled completely) to 4.0.14 and when recompiling my program get the following errors: --- /usr/include/voodoo2/mysq