Access denied; you need the RELOAD privilege for this operation
Hi everyone -- I'm pretty new to MySql, but not many years ago I was an ISAM guy so I understand the issues with indexes and on-the-fly inserts. I've seen many questions around this error message, Access denied; you need the RELOAD privilege for this operation. But I'm not grokking the answers. Is it true that I cannot get all the privs I need on a database that I have created? If so, then what's a reasonable way for MySql users to get around this restriction? In my particular case, cPanel tells me MySQL version 5.0.81-community. I have a table usrs in my ISAM DB into which I want to insert a row. I execute this C-connector code before the insert: err = mysql_query( pmysql, lock table usrs write; ); err = mysql_query( pmysql, flush table usrs; ); The error return from flush table is Access denied; you need the RELOAD privilege for this operation After the insert (which completes without error) I execute the flush table call again prior to issuing unlock tables; The error return to the second flush table is likewise Access denied. I think I understand (from reading the net) that only root can grant RELOAD privs. So of course the many responses to this question everywhere often begin, It's so very simple! Just login as root and ... :-) Since I'm on a shared-host ISP, I need to get the admin to grant me RELOAD privs. But it seems that RELOAD priv is a MySql-wide priv, not a per-database or per-user priv. So no admin will go for that. The other alternative, I guess, is for me to ask the admin to execute a flush table on my table from time to time, every few days, say. Do I have the correct understanding of the situation? And how do people usually deal with this error? Thanks so much! I apologize for the newb-level question and really appreciate your help. -- Pete -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
What should it be in MySql? In C, it's an array of integers.
Hi folks -- What would be the right approach in MySql 5.0? My table, USERS, has columns NAME and IP. Associated with each user is also a collection of from 0 to 50 INTs. What's a reasonable way to put these 50 INTs in the table without using 50 separate columns, INT01...INT50? Is BLOB an OK approach? I have to manipulate these INTs in my CGI code. Thanks! -- Pete -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: What should it be in MySql? In C, it's an array of integers.
Pete wrote: Hi folks -- What would be the right approach in MySql 5.0? My table, USERS, has columns NAME and IP. Associated with each user is also a collection of from 0 to 50 INTs. What's a reasonable way to put these 50 INTs in the table without using 50 separate columns, INT01...INT50? Is BLOB an OK approach? I have to manipulate these INTs in my CGI code. Thanks! -- Pete Break them out into a separate table linked via the primary key. How elegant! Thanks. -- Pete -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Can a MyISAM DB hold /everything/?
Hi folks -- I am new to MySQL and just laying out what I hope will be just one db that holds all the info for a list of forged or machined metal parts. Let's say there are 10,000 such parts, each with a unique part number. That part number is the primary index. Each part has at least one, and maybe several, accompanying photos. And each part has at least one, and perhaps as many as five, human-language descriptions. These descriptions might be as long as 5,000 characters each. I believe I have the choice of: 1. Storing everything -- photos and descriptions included -- in the database; or 2. Holding some info in the database; and storing photos and descriptions in normal-type disk files apart from the database, with names based on part numbers. So my questions: 1. Which scheme is faster and less resource-hogging in reading, updating, adding, and deleting? 2. I understand there are problems in storing photos in the db. Can one overcome these problems somehow? Thanks! -- Pete -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: MAC address as primary key - BIGINT or CHAR(12)
I'm new to MySQL so can't answer the OP's question, but: MAC addresses do not by design contain letters. Native MAC addresses are 48-bit (6-byte) integers: http://standards.ieee.org/getieee802/download/802-2001.pdf The confusion arises because a MAC address is usually /represented/ as hexadecimal, and that might contain letters, but MAC addresses natively are pure 6-byte integers. So the issue is whether you want to index by a 48-bit number or a 12-character ascii string. For efficiency's sake, I'm guessing you'd choose the former. I'll be interested in the answer, though, from someone with experience. -- Pete Wilson http://www.pwilson.net/ --- On Thu, 5/14/09, Jim Lyons jlyons4...@gmail.com wrote: From: Jim Lyons jlyons4...@gmail.com Subject: Re: MAC address as primary key - BIGINT or CHAR(12) To: Ilia KATZ ik...@dane-elec.co.il Cc: mysql@lists.mysql.com Date: Thursday, May 14, 2009, 11:38 AM Definitely CHAR (or VARCHAR). If the format of a MAC address changes at all, you could be in real trouble. Also, if a MAC address can have a leading 0 (I don't know anything about MAC addresses), then storing it as some sort of number could lose that. This is a general rule for me. A field might only contain numbers (at one particular point in time) but if those numbers are really nominal data (in which the size or order does not matter) then they should be CHAR or VARCHAR fields anyway. On Thu, May 14, 2009 at 8:26 AM, Ilia KATZ ik...@dane-elec.co.il wrote: Hi. Currently I have a table: 1. MAC address defined as BIGINT 2. MAC address set as primary key Should I consider changing it to CHAR(12)? Replies will be appreciated. Ilia -- Jim Lyons Web developer / Database administrator http://www.weblyons.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: MAC address as primary key - BIGINT or CHAR(12)
I agree, and didn't mean to say that I disagreed. This is certainly one of the top five principles to follow, imo. Too many times, while trouble-shooting, I've run up on the rock of a binary (meaning: indecipherable) field. What is the cost of including the binary representation (for indexing) and also the readable representation (just for debugging/problem-solving)? (Well, of course I know what the cost is: it's 12 bytes, plus overhead, per row.) It all depends, but in general, would you call that too costly, given the benefit? -- Pete Wilson http://www.pwilson.net/ --- On Thu, 5/14/09, Jim Lyons jlyons4...@gmail.com wrote: From: Jim Lyons jlyons4...@gmail.com As I said in my post, this is a general principle for me. Nominal data should have a data type of some sort of character. You will never run into unexpected problems down the line. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Re: A good US Hosting Site?
http://www.kionic.com I've been a very active and heavy customer for years and very satisfied. -- Pete Wilson http://www.pwilson.net/ --- On Sun, 4/19/09, Cameron Rogers cameronl...@gmail.com wrote: From: Cameron Rogers cameronl...@gmail.com Subject: A good US Hosting Site? To: mysql@lists.mysql.com Date: Sunday, April 19, 2009, 11:42 PM Hi everyone. I am starting my first web site. I have a temporary contract with godaddy but know there are better options out there. The only problem is, I don't know reliable sources to research which hosting program to use. Any recommendations on a hosting sight or some good resources to find a hosting site. I need a hosting site that allows me to: 1. Use PHP/MYSQL 2. Send 1000 + emails a day -- the mail function has been my greatest limitation with godaddy Thanks in advance, Cameron -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Error msg: MySQL server has gone away
Hi folks -- New to MySQL. I'm developing C-language connector software and, while debugging, I often get the error message MySQL server has gone away if, say, I've stopped at a breakpoint and then issued a call that resembles: mysql_query(pmysql, insert into usrs(usr,email) values(\pete\, \p...@pwilson.net\); ); I can imagine this happening when the connector is running in real life. So: What is the correct and reasonable way for a running connector to deal with this error intelligently? Thanks! -- Pete Wilson http://www.pwilson.net/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
success return from mysql_query() when error return was expected
Hi everyone -- I'm a MySQL noob. I have MySQL queries in my C code and I was surprised to find I'm getting a success return from: mysql_query(pmysql, select * from usrs where(usr=\illegal name\); In this table called usrs, usr is the primary key and the engine is myisam. I expected an error return from this query on illegal name, which is not in the table. An error is not returned until I call: prow = mysql_fetch_row(pmysqlres)); which returns NULL, which is great. If I run that same select from the command line, I see: mysql select * from usrs where (usr=illegal name); Empty set (0.00 sec) My question, finally: Is this response to my program call expected and normal for MySQL? I suppose it is, but I just want to make sure that the behavior is OK, that indeed the program call to mysql_query(select ...) must always in these circumstances return success. Thanks! -- Pete Wilson -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org