Disk Space Full
Hello All While my mysql code was running, the disk where the database was present got full and wht happened was tht the process hanged. It would not return from the query. N in the log file it was showing 070130 10:22:47 [ERROR] /usr/local/mysql-max-5.0.27-hpux11.11-hppa2.0w-64bit/bin/mysqld: Disk is full writing './diameter/audit_table.MYD' (Errcode: 28). Waiting for someone to free space... Retry in 60 secs So my ques is/are: Is there any alternative that I can come to know beforehand that the disk is full so that i don't fire a query? At the time of connection or creating a table can I tell the server to stop accepting queries once the DB reaches a threshold (in terms of size/queries) Or any other alternative so that the at least the control returns to my code where i can handle this situation! -- Bye for now, Nishant God Gave Me Nothing I Wanted, He Gave Me Everything I Needed !
mysql server has gone away
If I fire a lot of querries, I get an error "mysql server has gone away/lost connection with the server" . I tried to use "mysql_ping()" to reconnect, but tht also fails... So shud i call real_connect again? I mean will it be gud practice tht way? I looked for such an error to have occured. I found mainly 2 reasons: 1-time out : this isn't possible as hundreds of queries r being fired in a few secs 2-a wrong query- i checked for the querry n it looked fine to me. Also i noticed that the querry tht actually gives this error is in fact executed n logged in the database even though it returns an error!!! But thereafter, no query even gets logged and all return the same error. do u knw any othr circumstances in which such an error occurs? n whts the best poss soln here- to do a reconnect -- Bye for now, Nishant God Gave Me Nothing I Wanted, He Gave Me Everything I Needed !
mysqld_safe failing
Hi all When i try to run mysqld_safe cmd, it fails saying : Starting mysqld daemon with databases from /var/lib/mysql STOPPING server from pid file /var/run/mysqld/mysqld.pid 070105 20:23:40 mysqld ended Also mysqld.pid does not exist at the given path! Any Idea what to do??? mysql_install_db is running fine as well. Contents of mysqld.log are : 070105 20:23:40 mysqld started InnoDB: Error: auto-extending data file ./ibdata1 is of a different size InnoDB: 0 pages (rounded down to MB) than specified in the .cnf file: InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages! InnoDB: Could not open or create data files. InnoDB: If you tried to add new data files, and it failed here, InnoDB: you should now edit innodb_data_file_path in my.cnf back InnoDB: to what it was, and remove the new ibdata files InnoDB created InnoDB: in this failed attempt. InnoDB only wrote those files full of InnoDB: zeros, but did not yet use them in any way. But be careful: do not InnoDB: remove old data files which contain your precious data! 070105 20:23:40 [ERROR] Can't init databases 070105 20:23:40 [ERROR] Aborting 070105 20:23:40 [Note] /usr/libexec/mysqld: Shutdown complete 070105 20:23:40 mysqld ended When i tried to see the shell script running, i get the following msg: sh -x bin/mysqld_safe --user=root + KILL_MYSQLD=1 + trap '' 1 2 3 15 + umask 007 + defaults= + case "$1" in ++ pwd + MY_PWD=/usr + test -d /usr/data/mysql -a -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld + test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a -x ./libexec/mysqld + MY_BASEDIR_VERSION=/usr + DATADIR=/var/lib/mysql + ledir=/usr/libexec + user=mysql + niceness=0 + test -x /usr/libexec/mysqld-max + MYSQLD=mysqld + pid_file= + err_log= + test -x ./bin/my_print_defaults + print_defaults=./bin/my_print_defaults + args= + SET_USER=2 ++ ./bin/my_print_defaults --loose-verbose mysqld server + parse_arguments --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --old_passwords=1 + pick_args= + test --datadir=/var/lib/mysql = PICK-ARGS-FROM-ARGV + for arg in '"$@"' + case "$arg" in ++ echo --datadir=/var/lib/mysql ++ sed -e 's;--datadir=;;' + DATADIR=/var/lib/mysql + for arg in '"$@"' + case "$arg" in ++ echo --socket=/var/lib/mysql/mysql.sock ++ sed -e 's;--socket=;;' + mysql_unix_port=/var/lib/mysql/mysql.sock + for arg in '"$@"' + case "$arg" in + test -n '' + test 2 -eq 2 + SET_USER=0 ++ ./bin/my_print_defaults --loose-verbose mysqld_safe safe_mysqld + parse_arguments --err-log=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid + pick_args= + test --err-log=/var/log/mysqld.log = PICK-ARGS-FROM-ARGV + for arg in '"$@"' + case "$arg" in ++ echo --err-log=/var/log/mysqld.log ++ sed -e 's;--err-log=;;' + err_log=/var/log/mysqld.log + for arg in '"$@"' + case "$arg" in ++ echo --pid-file=/var/run/mysqld/mysqld.pid ++ sed -e 's;--pid-file=;;' + pid_file=/var/run/mysqld/mysqld.pid + parse_arguments PICK-ARGS-FROM-ARGV --user=root + pick_args= + test PICK-ARGS-FROM-ARGV = PICK-ARGS-FROM-ARGV + pick_args=1 + shift + for arg in '"$@"' + case "$arg" in ++ echo --user=root ++ sed -e 's;--[^=]*=;;' + user=root + SET_USER=1 + safe_mysql_unix_port=/var/lib/mysql/mysql.sock + test '!' -x /usr/libexec/mysqld + test -z /var/run/mysqld/mysqld.pid + case "$pid_file" in + test -z /var/log/mysqld.log + test -n /var/lib/mysql/mysql.sock + args='--socket=/var/lib/mysql/mysql.sock ' + test -n '' + test 0 -eq 0 + NOHUP_NICENESS=nohup + nohup nice ++ nice + normal_niceness=0 ++ nohup nice + nohup_niceness=0 + numeric_nice_values=1 + for val in '$normal_niceness' '$nohup_niceness' + case "$val" in + for val in '$normal_niceness' '$nohup_niceness' + case "$val" in + test 1 -eq 1 + nice_value_diff=0 + test 1 -eq 0 + USER_OPTION= + test -w / -o root = root + test root '!=' root -o 1 = 1 + USER_OPTION=--user=root + touch /var/log/mysqld.log + chown root /var/log/mysqld.log + test -n '' + test -n '' + test -f /var/run/mysqld/mysqld.pid + echo 'Starting mysqld daemon with databases from /var/lib/mysql' Starting mysqld daemon with databases from /var/lib/mysql ++ date '+%y%m%d %H:%M:%S mysqld started' + echo '070105 20:22:45 mysqld started' + true + rm -f /var/lib/mysql/mysql.sock /var/run/mysqld/mysqld.pid + test -z '--socket=/var/lib/mysql/mysql.sock ' + eval 'nohup /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=root --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/lib/mysql/mysql.sock >> /var/log/mysqld.log 2>&1' ++ nohup /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=root --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --socket=/var/lib/mysql/mysql.sock + test '!' -f /var/run/mysqld/mysqld.pid + echo 'STOPPING server from pid file /var/run/mysqld/mysqld.pid' STOPPING server from pid file /var/run/mysqld/mysqld.pid + break ++ date '+%y%m%d %H:%M:%S' + echo '070105 20:22:45 mysqld ended' + tee -a /var/log/mysqld.log 070105 20:22:45 mysqld ended + echo '' +
Core dump in mysql_real_connect( )
Hello All If I compile my code with Purify (a memory tool), I get a core dump in mysql_real connect. at teh follwing path : Program received signal SIGSEGV, Segmentation fault. 0x007acb37 in mysql_manager_fetch_line () from /opt/Rational/releases/purecov.i386_linux2.2003a.06.15//cache/getz/usr/lib/mysql/libmysqlclient_r.so.14_pure_p0_c0_104011552_269-5EL_32 (gdb) bt #0 0x007acb37 in mysql_manager_fetch_line () from /opt/Rational/releases/purecov.i386_linux2.2003a.06.15//cache/getz/usr/lib/mysql/libmysqlclient_r.so.14_pure_p0_c0_104011552_269-5EL_32 #1 0x007ca960 in my_strnncoll_gbk () from /opt/Rational/releases/purecov.i386_linux2.2003a.06.15//cache/getz/usr/lib/mysql/libmysqlclient_r.so.14_pure_p0_c0_104011552_269-5EL_32 #2 0x007cad8a in my_xml_parse () from /opt/Rational/releases/purecov.i386_linux2.2003a.06.15//cache/getz/usr/lib/mysql/libmysqlclient_r.so.14_pure_p0_c0_104011552_269-5EL_32 #3 0x007bd2e3 in my_parse_charset_xml () from /opt/Rational/releases/purecov.i386_linux2.2003a.06.15//cache/getz/usr/lib/mysql/libmysqlclient_r.so.14_pure_p0_c0_104011552_269-5EL_32 #4 0x007b3e73 in my_charset_same () from /opt/Rational/releases/purecov.i386_linux2.2003a.06.15//cache/getz/usr/lib/mysql/libmysqlclient_r.so.14_pure_p0_c0_104011552_269-5EL_32 #5 0x007b40ea in add_compiled_collation () from /opt/Rational/releases/purecov.i386_linux2.2003a.06.15//cache/getz/usr/lib/mysql/libmysqlclient_r.so.14_pure_p0_c0_104011552_269-5EL_32 #6 0x007b4b03 in get_charset_by_csname () from /opt/Rational/releases/purecov.i386_linux2.2003a.06.15//cache/getz/usr/lib/mysql/libmysqlclient_r.so.14_pure_p0_c0_104011552_269-5EL_32 #7 0x007cec07 in mysql_real_connect () from /opt/Rational/releases/purecov.i386_linux2.2003a.06.15//cache/getz/usr/lib/mysql/libmysqlclient_r.so.14_pure_p0_c0_104011552_269-5EL_32 #8 0x0807fe09 in main () at test.c:37 Here is the snippet of my code : system("mysqld_safe"); mysql_server_init(num_elements, server_options, server_groups); mysql = mysql_init(NULL); mysql_options(mysql, MYSQL_READ_DEFAULT_GROUP, "libmysqld_client"); mysql_options(mysql, MYSQL_OPT_USE_EMBEDDED_CONNECTION, NULL); mysql_real_connect(mysql, "127.0.0.1",NULL,NULL, "audit", 0,NULL,0); I also checked and found the mysql pointer to be correct just before mysql_real_connect( ) call. But if i compile it without Purify, the whole code works absolutely fine. Any idea what might be triggering this crash? -- Bye for now, Nishant God Gave Me Nothing I Wanted, He Gave Me Everything I Needed !
Re: MySSQL on HP-UX
well the problem was olved when i used the follwoing command scripts/mysql_install_db --user=root bin/mysqld_safe --user=root Gues by default it was not creating the mysql user. Now on prompt mysql is running fine... But... As I am trying to port my MySQL code on HP-UX, and am unable to link my code as I am getting the standard functions like mysql_query(), mysql_store_result() etc as undefined. I am currently linking my code with libmysqlclient_r.a. Do I need any other library to be linked as well?? Note that the same code runs perfectlty fine on Linux On 12/13/06, Nils Meyer <[EMAIL PROTECTED]> wrote: Hi, Nishant Gupta wrote: > [/usr/local/mysql-5.1.12-beta-hpux11.11-hppa2.0w ]scripts/mysql_install_db > --user=mysql > chown: unknown user id mysql > Installing all prepared tables > 061212 19:39:30 [ERROR] Fatal error: Can't change to run as user > 'mysql' ; > Please check that the user exists! Did you do that? Is there a user called "mysql"? regards Nils -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- Bye for now, Nishant God Gave Me Nothing I Wanted, He Gave Me Everything I Needed !
Definition of mysql_server_init
Hi All I am trying to port my MySQL code on HP-UX, and am anuable to link my code as I am getting the standard functions like mysql_query(), mysql_store_result() etc as undefined. I am currently linking my code with libmysqlclient_r.a. Do I need any other library to be linked as well?? -- Bye for now, Nishant God Gave Me Nothing I Wanted, He Gave Me Everything I Needed !
MySSQL on HP-UX
*When I am trying to run mysqld-safe, i get the follwoing error* [/usr/local/mysql-5.1.12-beta-hpux11.11-hppa2.0w] ./bin/mysqld_safe chown: unknown user id mysql Starting mysqld daemon with databases from /usr/local/mysql- 5.1.12-beta-hpux11.11-hppa2.0w/data STOPPING server from pid file /usr/local/mysql- 5.1.12-beta-hpux11.11-hppa2.0w/data/josh.pid 061212 19:43:57 mysqld ended *As its a fresh installation and now as I am trying to run mysql_install_db, I get the following mesaage* [/usr/local/mysql-5.1.12-beta-hpux11.11-hppa2.0w]scripts/mysql_install_db --user=mysql chown: unknown user id mysql Installing all prepared tables 061212 19:39:30 [ERROR] Fatal error: Can't change to run as user 'mysql' ; Please check that the user exists! 061212 19:39:30 [ERROR] Aborting 061212 19:39:30 [Note] ./bin/mysqld: Shutdown complete Installation of system tables failed! *Any idea what to do* Regards, Nishant Gupta Aricent (Flextronics Software Systems) Ph No- 0124-245 Extn -5256
Header Files
Hello all I know its a very small thing to ask, but since am kinda stuck over this, plz consider this is as imp. Kindly let me know which header file do we need to include in order to use NOW( ) fn while using MySQL in C/C++. Thanks in advance... -- Bye for now, Nishant God Gave Me Nothing I Wanted, He Gave Me Everything I Needed !
Sample program
Hello all Sorry to disturb you, but am trying to start using MySql on Linux using C/C++. All the sample programs I found are merely compilable but crash while running. Can anyone post a simple program to insert a record in a table in a database? One more thing i needed to know that do we need to run mysqld_safe command while running a mysql program in C/C++?? Thanks in advance n sorry for the inconvinience!