Re: Duplicate Insert Crashes Client
Ok, I found this one too. It was my own client, and of course, the problem was on my side of things. I want to thank everyone who replied. What was happening was I was trying to free the mysql structure and it was already freed. On Nov 14, 2005, at 6:50 PM, Gleb Paharenko wrote: Hello. Ok new problem. If for some reason, my client tries to INSERT something Please could you answer, what kind of client do you mean. Is it your own client application or mysql command line client or something else? If it is yours and it is small, you can send the code to the list, include the 'CREATE' statement for you table and sample data. Provide information about operating system and MySQL version. Bruce Martin wrote: Hello again, Ok new problem. If for some reason, my client tries to INSERT something to the database that is identical to a record already there, my client crashes. Is there an error I can trap for this? The DB does insert the new record. Bruce Martin The Martin Solution PO Box 644 Delaware Water Gap, PA (570) 421-0670 [EMAIL PROTECTED] -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.NET http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Gleb Paharenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.NET ___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] Bruce Martin The Martin Solution PO Box 644 Delaware Water Gap, PA (570) 421-0670 [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Duplicate Insert Crashes Client
Hello again, Ok new problem. If for some reason, my client tries to INSERT something to the database that is identical to a record already there, my client crashes. Is there an error I can trap for this? The DB does insert the new record. Bruce Martin The Martin Solution PO Box 644 Delaware Water Gap, PA (570) 421-0670 [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: mysql_init(m) changes values of variables
Ok I have an update. I fixed my problem by passing a NULL parameter to mysql_init() to do this I did this: MYSQL *m; m=mysql_init(NULL); connection=mysql_real_connect(m,cStrdbServer,cStrdbUser,cStrdbUserPass,c StrdbName,0,NULL,0); On Nov 12, 2005, at 7:44 PM, Bruce Martin wrote: Hello all, I found this odd thing when writing a client in C to connect to a mysql database server. I want to use mysql_real_query so I need the strlen() of the sqlStatement. So prior to calling mysql_init(m) I get the length of the sqlStatement. I check that length and it is correct after I first set it up the length is 23 which is correct. I then call mysql_init(m), then I check the length again, well the value of the int I set earlier, and it is 0. What's the deal? why would mysql_init() change the value of my int? Bruce Martin The Martin Solution PO Box 644 Delaware Water Gap, PA (570) 421-0670 [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] Bruce Martin The Martin Solution PO Box 644 Delaware Water Gap, PA (570) 421-0670 [EMAIL PROTECTED]
mysql_init(m) changes values of variables
Hello all, I found this odd thing when writing a client in C to connect to a mysql database server. I want to use mysql_real_query so I need the strlen() of the sqlStatement. So prior to calling mysql_init(m) I get the length of the sqlStatement. I check that length and it is correct after I first set it up the length is 23 which is correct. I then call mysql_init(m), then I check the length again, well the value of the int I set earlier, and it is 0. What's the deal? why would mysql_init() change the value of my int? Bruce Martin The Martin Solution PO Box 644 Delaware Water Gap, PA (570) 421-0670 [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: libmysqld as shared library
Check out this link: http://dev.mysql.com/doc/refman/5.0/en/building-clients.html I was having a similar problem, but after I did what this page said it worked. On Nov 10, 2005, at 5:24 AM, Peter M. Groen wrote: Hi everyone, Iḿ new on this list, so please forgive me if i'm asking something already discussed. (Found nothing in the archives, though) For this project we're doing, we try to build qt 4.0.1 with embedded mysql-support. The qt-part is no problem, but mysql 5.0.15 won't let me build a shared library for libmysqld. Very strange. According to the documentation, I have to give: ./configure --with-embedded-server --enable-shared=yes but no lib is being build... make even errors on the libmysqld/examples directory ('no rules to make target') I even tried (In my despair) a line like : ./configure --with-embedded-server --enable-shared=yes --enable-static=no but this gives me an error also: then mv -f .deps/liboptions_a-priv.Tpo .deps/liboptions_a-priv.Po; else rm -f .deps/liboptions_a-priv.Tpo; exit 1; fi make[3]: *** No rule to make target `../../libmysql/get_password.o', needed by `liboptions.a'. Stop. make[3]: Leaving directory `/home/pgroen/projects/mysql-5.0.15/server-tools/instance-manager' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/pgroen/projects/mysql-5.0.15/server-tools' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/pgroen/projects/mysql-5.0.15' make: *** [all] Error 2 I'm quite desperate at the moment because our first demo is due next week What am I doing wrong? Regards, Peter -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] Bruce Martin The Martin Solution PO Box 644 Delaware Water Gap, PA (570) 421-0670 [EMAIL PROTECTED]
Re: Add New User
Ok thank you for your replies. I finally got it working, but as you stated I granted too many permissions. I found that in the user table my testUser had N for every column with the exception of the last few which where 0. I first logged into the database using: shellmysql -u root -p mysql So I used: mysqlGRANT ALL PRIVILEGES ON test.* TO 'testUser'@'localhost' IDENTIFIED BY 'some_password'; and: mysqlGRANT ALL PRIVILEGES ON test.* TO 'testUser'@'%' IDENTIFIED BY 'some_password'; Then I did: mysql select * from user where user.User='testUser'; Which returned: | Host | User | Password | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections | +---+--+--- +-+-+-+-+- +---+-+---+--+--- ++-++ +--++---+-- +--+-+--+-- ++-+ +--+--++- +--+---+-+- +--+ | % | testUser | *12F46AB3EF1939F7B217B125466177AFA18495CF | N | N | N | N | N | N | N | N | N| N | N | N | N | N | N| N | N | N| N| N | N| N| N | N | N | N| | | | | 0 | 0 | 0 |0 | | localhost | testUser | *12F46AB3EF1939F7B217B125466177AFA18495CF | N | N | N | N | N | N | N | N | N| N | N | N | N | N | N| N | N | N| N| N | N| N| N | N | N | N| | | | | 0 | 0 | 0 |0 | I then did: UPDATE user SET Select_priv='Y',Insert_priv='Y',Update_priv='Y',Delete_priv='Y',Create_p riv='Y' WHERE user.User='testUser'; I can now access the server using my test user: testUser. However, even though I specified 'test.*' my test user can access the mysql database. doesn't test.* limit the user to the test database? or should it have been 'test' no quotes of course. Is there a way to update the database access without deleting the user and redoing it all? Thanks for the help. On Nov 6, 2005, at 12:23 AM, Michael Stassen wrote: Bruce Martin wrote: When I log in as root using: mysql -u root -p mysql I get the mysql prompt: mysql I then issue this command or statement: mysqlGRANT ALL PRIVILEGES ON *.* TO 'testUser'@'' IDENTIFIED BY 'some_password' WITH GRANT OPTION; First, your hostname is blank. That won't work. You need to either specify a hostname, or use the wildcard character, '%'. See the manual for details http://dev.mysql.com/doc/refman/5.0/en/connection-access.html. Second, why are you making testuser equivalent to root? Don't give a user any more privileges than necessary. For a test user, I'd suggest starting with just GRANT ALL PRIVILEGES ON test.* TO 'testUser'@'localhost' IDENTIFIED BY 'some_password'; I get the following returned: Query OK, 0 rows affected (0.00 sec) Why is this not working? What makes you think it didn't work? You didn't get an error message. Instead, you got Query OK. Looks like it worked, to me. To test it further I try to log in as testUser but it tells me access denied for user [EMAIL PROTECTED] That's not the whole error message. Please show us your exact comand, and copy/paste the exact error message. We could try to guess what's wrong (probably there is no [EMAIL PROTECTED]), but it's better not to guess. Even if I grant the testUser
Re: Add New User
Ok thank you, I think I have it now. Now to get my Client application working. On Nov 6, 2005, at 1:16 PM, Björn Persson wrote: söndagen den 6 november 2005 18:39 skrev Bruce Martin: However, even though I specified 'test.*' my test user can access the mysql database. That's because this statement: UPDATE user SET Select_priv='Y',Insert_priv='Y',Update_priv='Y',Delete_priv='Y',Create _p riv='Y' WHERE user.User='testUser'; granted those privileges on _all_ databases. Björn Persson -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] Bruce Martin The Martin Solution PO Box 644 Delaware Water Gap, PA (570) 421-0670 [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Add New User
When I log in as root using: mysql -u root -p mysql I get the mysql prompt: mysql I then issue this command or statement: mysqlGRANT ALL PRIVILEGES ON *.* TO 'testUser'@'' IDENTIFIED BY 'some_password' WITH GRANT OPTION; I get the following returned: Query OK, 0 rows affected (0.00 sec) Why is this not working? To test it further I try to log in as testUser but it tells me access denied for user [EMAIL PROTECTED] Even if I grant the testUser @ localhost. I can look in the user table and sure enough user [EMAIL PROTECTED] is there. Bruce Martin The Martin Solution PO Box 644 Delaware Water Gap, PA (570) 421-0670 [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Permissions for the install
What should the permissions be for the MySQL 5 install on Mac OS X. By default it was Owner = System Group = wheel. Could someone give me a list of directories and what owner:group settings I should have? Bruce Martin The Martin Solution PO Box 644 Delaware Water Gap, PA (570) 421-0670 [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
mysql_library_init()
I noticed my client crashes when I try to connect to MySQL 5 server. My client was written against the MySQL 4 C API's. So I looked at the new Docs for MySQL 5 C API's and noticed a new function, mysql_library_init(). I see it has 3 parameters. int mysql_library_init(int argc, char **argv, char **groups) Can someone explain what the 3 parameters are and what they need for info? The docs are a bit light on this subject and it says it is synonym for the mysql_server_init() function, but that function is not listed and is not linked to in the on-line docs. Bruce Martin The Martin Solution PO Box 644 Delaware Water Gap, PA (570) 421-0670 [EMAIL PROTECTED]
Trouble running mysql_install_db
Hello all, I just installed MySQL 5 on Mac OS 10.3.9. Now when I try to create a user using any method it does not work. I read I may have to run the mysql_install_db script so I did, but I get these results: mkdir: ./data/mysql: Permission denied chmod: ./data/mysql: Permission denied mkdir: ./data/test: Permission denied chmod: ./data/test: Permission denied Installing all prepared tables 051027 5:29:02 [Warning] Can't create test file /usr/local/mysql-standard-5.0.15-osx10.3-powerpc/data/24.lower-test ./bin/mysqld: Can't change dir to '/usr/local/mysql-standard-5.0.15-osx10.3-powerpc/data/' (Errcode: 13) 051027 5:29:02 [ERROR] Aborting 051027 5:29:02 [Note] ./bin/mysqld: Shutdown complete ./bin/mysql_create_system_tables: line 766: 674 Broken pipe cat END_OF_DATA use mysql; set table_type=myisam; $c_d $i_d $c_h $i_h $c_u $i_u $c_f $i_f $c_t $c_c $c_ht $c_hc $c_hr $c_hk $c_tzn $i_tzn $c_tz $i_tz $c_tzt $i_tzt $c_tztt $i_tztt $c_tzls $i_tzls $c_p $c_pp END_OF_DATA Installation of system tables failed! Examine the logs in ./data for more information. You can also try to start the mysqld daemon with: ./bin/mysqld --skip-grant You can use the command line tool ./bin/mysql to connect to the mysql database and look at the grant tables: shell ./bin/mysql -u root mysql mysql show tables Try 'mysqld --help' if you have problems with paths. Using --log gives you a log in ./data that may be helpful. The latest information about MySQL is available on the web at http://www.mysql.com Please consult the MySQL manual section: 'Problems running mysql_install_db', and the manual section that describes problems on your OS. Another information source is the MySQL email archive. Please check all of the above before mailing us! And if you do mail us, you MUST use the ./bin/mysqlbug script! I then checked the permissions for the /usr/local/mysql/data/ directory and it shows: drwxr-x--- 13 mysql wheel What am I missing? I installed MySQL using the installer package. Bruce Martin The Martin Solution PO Box 644 Delaware Water Gap, PA (570) 421-0670 [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: String insertion
Can you force it to keep the space by escaping the space? Something like: mysql insert into test_strings set foo_1=' test\ ',foo_2=' test\ ',foo_3=' test\ ',foo_4=' test\ '; On Oct 24, 2005, at 5:34 AM, Andreas Steichardt wrote: Hi! I just hit something really strange which is either a bug in MySQL or a dumbness bug of me. I am trying to insert a string ending with a simple space and i really want this space at the end of my string ;). Unfortunately MySQL kills this whitespace when inserting into normal (var)char columns: mysql create table test_strings (foo_1 varchar(255),foo_2 char(255),foo_3 text,foo_4 blob); Query OK, 0 rows affected (0.00 sec) mysql insert into test_strings set foo_1=' test ',foo_2=' test ',foo_3=' test ',foo_4=' test '; Query OK, 1 row affected (0.00 sec) mysql select length(foo_1),length(foo_2),length(foo_3),length(foo_4) from test_strings; +---+---+---+---+ | length(foo_1) | length(foo_2) | length(foo_3) | length(foo_4) | +---+---+---+---+ | 5 | 5 | 6 | 6 | +---+---+---+---+ 1 row in set (0.00 sec) Is this a feature or am i missing something. text would do it for me but it is a total waste of space. Any ideas? Kind regards, Andreas Streichardt -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] Bruce Martin The Martin Solution PO Box 644 Delaware Water Gap, PA (570) 421-0670 [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Compiling a MySQL Client using Apple's xCode
Hello all, I have been working on a MySQL client which I wrote in Apple's xCode. The client works as long as it is on my machine which has MySQL installed, however if I send the client to another computer which does not have MySQL installed it does not work. I am under the impression I need to include some libs with this client, but which libs and how can I do that in xCode? Thank you, Bruce Martin The Martin Solution PO Box 644 Delaware Water Gap, PA (570) 421-0670 [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]