MySQL 3.23.33 mysqldump of mysql database has syntax errors in table creation
Description: When dumping the 'mysql' database, the dump file contains syntax errors, and I can't find where this has been rectified in later releases. Example dump using 'mysqldump -cl mysql': [snip]# # Table structure for table 'db' # CREATE TABLE db ( Host char(60) NOT NULL default '', Db char(32) NOT NULL default '', User char(16) NOT NULL default '', Select_priv enum('N','Y') NOT NULL default 'N', Insert_priv enum('N','Y') NOT NULL default 'N', Update_priv enum('N','Y') NOT NULL default 'N', Delete_priv enum('N','Y') NOT NULL default 'N', Create_priv enum('N','Y') NOT NULL default 'N', Drop_priv enum('N','Y') NOT NULL default 'N', Grant_priv enum('N','Y') NOT NULL default 'N', References_priv enum('N','Y') NOT NULL default 'N', Index_priv enum('N','Y') NOT NULL default 'N', Alter_priv enum('N','Y') NOT NULL default 'N', PRIMARY KEY (Host,Db,User), KEY User(User) ) TYPE=MyISAM; [/snip] Trying to re-load this table fails with the following error message: ERROR 1064: You have an error in your SQL syntax near 'User(User) ) TYPE=MyISAM' at line 16 Hopefully I'm not just re-iterating a previously fixed problem. Feel free to email me if more information is needed. How-To-Repeat: Dumping the mysql database is enough to re-create this problem. (Checked in both 3.23.33 and 3.23.32.) Fix: Changing KEY User(User) To KEY User (User) In the dump fixes this. Submitter-Id: None Originator:Tony Wells Organization: None MySQL support: none Synopsis: mysqldump of mysql database has syntax error in SQL Severity: non-critical Priority: Category: mysql Class: Release: mysql-3.23.33 (Source distribution) Server: /usr/local/bin/mysqladmin Ver 8.15 Distrib 3.23.33, for -freebsd4.2 on i386 Copyright (C) 2000 MySQL AB MySQL Finland AB TCX DataKonsult AB This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL license Server version 3.23.33 Protocol version10 Connection Localhost via UNIX socket UNIX socket /tmp/mysql.sock Uptime: 3 min 37 sec Threads: 1 Questions: 195 Slow queries: 0 Opens: 64 Flush tables: 1 Open tables: 58 Queries per second avg: 0.899 Environment: System: FreeBSD camel.kdsi.net 4.5-STABLE FreeBSD 4.5-STABLE #0: Wed Apr 24 10:19:40 CDT 2002 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/IPFW i386 Some paths: /usr/bin/perl /usr/bin/make /usr/local/bin/gmake /usr/bin/gcc /usr/bin/cc GCC: Using builtin specs. gcc version 2.95.3 20010315 (release) [FreeBSD] Compilation info: CC='cc' CFLAGS='-O -pipe' CXX='c++' CXXFLAGS='-O -pipe -felide-constructors -fno-rtti -fno-exceptions' LDFLAGS='' LIBC: -r--r--r-- 1 root wheel 1221930 Apr 24 11:25 /usr/lib/libc.a lrwxr-xr-x 1 root wheel 9 Apr 24 11:25 /usr/lib/libc.so - libc.so.4 -r--r--r-- 1 root wheel 579224 Apr 24 11:25 /usr/lib/libc.so.4 Configure command: ./configure --localstatedir=/var/db/mysql --without-perl --without-debug --without-readline --without-bench --with-mit-threads=no --with-libwrap --with-low-memory --enable-assembler --prefix=/usr/local i386--freebsd4.2 Perl: This is perl, version 5.005_03 built for i386-freebsd - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Installing PHP with MySQL
Ralf R. Kotowski wrote: I did install all RPM's exept the benchmark. What is the name of the header files? On 3 Oct 2001, at 14:20, Carl Troein wrote: Ralf R. Kotowski writes: I got Red Hat 6.2 and the Mysql 3.23.36-1 RPM packages installed, when I try to compile PHP with MySQL it tells me that it can't find the mysql header files... now where are those located? I tried specifying every dir that has something to do with MySQL, no luck. If you have a recent version of PHP, it already has header files for MySQL as part of the dist. Just use: --with-mysql As one of the arguments to 'configure', without a path, and PHP will use it's own copies of the MySQL header files. Did you install all 5 RPMs or just a subset of them? As far as I can tell, you need to install the RPM that has 'devel' in its name. If you've already done so and it still doesn't work, try locating the files with 'find', or something. //C -- Carl Troein - CĂrdan / Istari-PixelMagic - UIN 16353280 [EMAIL PROTECTED] | http://pixelmagic.dyndns.org/~cirdan/ Amiga user since '89, and damned proud of it too. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: PHP/MySQL question - need help with fputs, mysql statements
Dave Lake wrote: Hi Folks I have used MySQL for some time and am just getting my head around PHP. I looked across a number of PHP sites for some input on this but failing to find an answer thought I would ask some MySQL users (surely many of you are using PHP right? ;-) ) for help. I recently read a tutorial on mysql/php on webmonkey (http://hotwired.lycos.com/webmonkey/99/21/index3a.html for the specific page if what I've written below isn't clear) After doing the mysql query the results are printed out to the screen/web page similar to: while ($myrow = mysql_fetch_array($result)) { printf(br%s: %s %s - %s\n, $myrow[pos], $myrow[first], $myrow[last], $myrow[age]); } Where I ran into a problem was when I attempted instead to write to a file. After opening the file I wanted to print out to I tried several different attempts to no avail. I tried fputs($theFile, br%s: %s %s - %s\n, $myrow[pos], $myrow[first], $myrow[last], $myrow[age]) Your PHP looks suspiciously like C... :) fputs in PHP doesn't do the % substitutions like printf. Try modifying the line to look like this and see if this works: (I'm assuming you're actually opening the file for a write...) fputs($theFile, br$myrow[pos]: $myrow[first] $myrow[last] - $myrow[age]\n); and other similar but kept getting string error messages. I eventually came up with the following solution: while ($myrow = mysql_fetch_array($result)) { $mypos = $myrow[pos]; $myfirst = $myrow[first]; $mylast = $myrow[last]; $myage = $myrow[age]; fputs($theFile, trtd$mypos/tdtd$myfirst/tdtd$mylast/tdtd$myage/td/tr\n); } This is okay if I am only grabbing four items but from some of my tables the query might return 20 columns. Wonder if you can explain two things for me? The %s in the printf statements above seem to be a placeholder associated with the $myrow[pos] for example. Can you use this in an fputs statement? How would I go about printing my mysql query out to a file rather than the screen? My solution above works but would be rather cumbersome, and I believe there should be a more straightforward way but I can't figure it out. Thanks in advance. Dave Lake [EMAIL PROTECTED] _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Host 'ip adddress'' is not allowed to connect to this MySQL server
Harpreet wrote: I am trying to use MYSQL CLIENT for the first time. I have setup the mysql server and connect to it from my machine using Telnet. But everytime i try to connect using mysql client or through access 2000 i get the following error: Host 'ip address' is not allowed to connect to this MySQL server please help and let me know what am i missing. From the online manual... If you get the following error when you try to connect from a different host than the one on which the MySQL server is running, then there is no row in the user table that matches that host: Host ... is not allowed to connect to this MySQL server You can fix this by using the command-line tool mysql (on the server host!) to add a row to the user, db, or host table for the user/hostname combination from which you are trying to connect and then execute mysqladmin flush-privileges. If you are not running MySQL Version 3.22 and you don't know the IP number or hostname of the machine from which you are connecting, you should put an entry with '%' as the Host column value in the user table and restart mysqld with the --log option on the server machine. After trying to connect from the client machine, the information in the MySQL log will indicate how you really did connect. (Then replace the '%' in the user table entry with the actual hostname that shows up in the log. Otherwise, you'll have a system that is insecure.) Another reason for this error on Linux is that you are using a binary MySQL version that is compiled with a different glibc version than the one you are using. In this case you should either upgrade your OS/glibc or download the source MySQL version and compile this yourself. A source RPM is normally trivial to compile and install, so this isn't a big problem. An early response will be appreciated. Regards, Harpreet Kaur Software Developer Crispin Corporations Inc. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: mysql_connect () and mysql_pconnect are not recognized ! Pls help.
It sounds like the PHP module was compiled without MySQL support. root wrote: Hi, I'm running mysql MAX 3.23.41 on LinuxPPC, everything was installed from an RPM. My problem is whenever I try to call mysql_connect (), from a php3 script, I got the error function not found or misconfigured The script is a simple form, that passes the data to be added to an empty database, with an empty table, both the MySQL server and Apache reside on the same machine, and because it's just a test, I'm entering as root. I am developing a more complex script , but I need to solve the connection problem first BTW ifyou define a var $link = mysql_connect ( localhost ) or ; , which is the correct syntax ? localhost or 'localhost' ? Why is the command failing ??? From the console it works BTW The server is on a static IP without a DNS, is it correct to set mysql_connect (xxx.xxx.xxx.xxx) or ('xxx.xxx.xxx.xxx' when you are running as localhost Thank you Regards, Rick - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
A couple of questions about connections
Hi all, I'm running MySQL Ver 3.23.32 for -freebsd4.2 on i386, With PHP4 compiled statically into Apache 1.3.17. All connections to the database are non-persistent connections. It's a pretty busy server, hitting about 60 queries per second during peak time. (Although I'm not sure that would qualify as busy on this list. :) I was wondering about a couple of the variables reported in 'mysqladmin extended-status', specifically 'aborted clients' and 'aborted connections' and what the difference between the two are. We get a lot of these, but I'm guessing this is just an artifact of users hitting the 'stop' button before a page finishes loading, or maybe not. The other question I have is after a period of time, maybe about a month, connections to the database will return an error 'Too many errors connecting to database, use mysqladmin flush-hosts ...' or something to that effect. (It's been awhile since it's happened.) Flushing the hosts solves the problem but I was wanting to do garbage collection on these connections to prevent this, and I was wondering what the best method would be. TIA, Tony Wells - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php