Re: Reading securely the value of an autoincrement field used as PK
Use a different connection for each thread. last_insert_id() is isolated per connection. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: PROBLEM WITH LOADING DATA
Can you post the code that does the update? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: 2 Quick Questions
Why use WinMySqlAdmin to view databases? The MySQL Control Center has a lot more features and its usage is very straight forward. If you are referring to the name that you gave it the first time you ran it then I don't know. I'm curious about how to set it myself. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Weird
Even though Napmarilu and localhost are resolving to the same machine, they are different host names. MySQL security uses a combination of username and hostname in the form of: [EMAIL PROTECTED] That means that [EMAIL PROTECTED] is a different user than [EMAIL PROTECTED] Since you have the Control center up, user the User Administration features to add a user with Napmarilu as it's host. If you want to do this with the command line client, look up Grant in the manual. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: installing mySQL on Windows 2000
Are you logged on as Administrator? Is there enough disk space free? Does it generate the same error if you try re-installing? Is there an existing installation with the server still running? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL Existing with other DBMSes
These are completely different programs so you shouldn't have any problems. I've never run into mention of any conflicts listed in the MySQL docs. You might check the docs of the other applications. I know the MSSQL and MySQL can co-exist. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Which one is better: CHAR or VARCHAR?
Char is more efficient when selecting but less efficient when storing (wastes space). It is a trade off so there really isn't a right answer. Do some experimenting and see what works best for you. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: HTML in Longtext
The double quotes have meaning in HTML. You might be confusing the parser. Try replacing your double quotes with quot. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Storing currency values
Just convert the format of the input in your program before saving the value. In VB/ASP us can do: replace(255,55,,,.) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Passwords query
These look like the security permissions for 3 MySQL user entries. The first one is the administrator account which can do pretty much anything. The second looks like an account used by a program. The third looks like it can be given to individual users as it can only looks at records, not change them. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: my.ini file for two instances of MySql - need help
# If you specify no service name, the server uses the default service name of MySQL and the server reads options from the [mysqld] group in the standard option files. # If you specify a service name after the --install option, the server ignores the [mysqld] option group and instead reads options from the group that has the same name as the service. The server reads options from the standard option files. # If you specify a --defaults-file option after the service name, the server ignores the standard option files and reads options only from the [mysqld] group of the named file. http://www.mysql.com/doc/en/Multiple_Windows_servers.html and http://www.mysql.com/doc/en/Multiple_Windows_services.html It sounds like MySQL uses the service name to determine the section of the my.cnf file to pull its settings from. The service name can be set when using the --install option. Follow the second like for an example my.cnf file. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Space Column
Just enclose the column name in backticks (upper left key on your keyboard just below ESC). Be warned that if you do this you will ALWAYS have to refer to this column using the backticks. It would be MUCH better to remove the space from the name. You might consider using an underscore instead. mysql CREATE TABLE g1 (`p1 GEOMETRY`); -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Can't create Database
It looks like you didn't specify a user. Try this: mysql -u root -p It will prompt you for the password that you set up for the root account. After you enter it you will get a mysql prompt. Now type: create database newdatabase; This will create a new database called newdatabase. You can list the databases that the current user has access to by issuing the show databases; command. Type quit to exit the mysql client program. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: What Does This Mean
Did you set a password for the root account? MySQL comes with a root user that (initially) has no password and all privileges. Most setup instructions have you assign a password to the root account pretty early on. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Mysql Problem...
Did you stop and restart the server while you had the client up? This will break the client's connection and force it to try and re-establish it. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: New INstall of MySQL
Comment out this line: datadir = c:/SQLData in the my.ini file in your windows (winnt) folder and remove the my.cnf from your c:\. Start the server. The default location of the data folder is c:/mysql/data. You told it to look in c:/SQLData and it can't find it's security database. Also you should have either my.ini OR my.cnf. Not both. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL Service starts and then Stops
Could you post the contents of you my.cnf (or my.ini) file? What OS are you trying to run the server on? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: How 'if not exists' implemented in MySQL?
First, please be aware that MySQL 5.0 is an alpha release. It is very young and there may still be some unresolved issues. It is not generally recommended to use alpha releases in production situations. Besides, anything that can be done in a stored procedure can be implemented in client side code. That said, the If Exists is used with Create and Drop statements. I don't think that you can use it to determine the rows returned by a select statement. There may be other techniques but this is what I'd do: Take your select query any convert it to a count(*) query and use Select Into to store the count in a variable. Use this variable in your if statement. See this chapter in Select Into: http://www.mysql.com/doc/en/SELECT_INTO_Statement.html If it isn't possible to turn your query into a count(*) then you might try using FOUND_ROWS(). See this chapther for more info: http://www.mysql.com/doc/en/Miscellaneous_functions.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Knowing the real size of a column
If you are using ADO then the field object has an actualsize property that should give you your value. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: When does using multiple databases make sense?
In our accounting software our users can manage the books for several different companies with the same program. As such I have to keep a field (in every record) that designates which company the given record is for and use it for report filtering, lookups, etc. Had I used a different database for each company then I would not need the overhead of this field. We chose the company field over the multiple databases because many of our clients are vertically integrated and do cross charging (an entry from one company posts to another company). This inter-company stuff is easy if the data is all in one database but we always have to remember to filter by the company field everywhere else. If I had it to do over again I'd probably use multiple databases. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: GUID
I don't think that Linux uses GUID's. They are a Microsoft construct. I just searched the MySQL manual and it doesn't mention them. What are you using them for? There may be an equivilent available. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Problem displaying 'count'
It sounds like Zeos is checking the value of the number and reducing it's data type if it can (for efficiency I guess). If cast isn't available in your version of MySQL you might try Convert(). Here's a manual link: http://www.mysql.com/doc/en/Cast_Functions.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: consistency checking InnoDB tables
I had the same question a while back and I was told that InnoDB does this automatically. There are no utilities that I could find. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: consistency checking InnoDB tables
Thanks for the correction. I didn't think to check InnoDB's docs. MySQL's docs don't mention this. Sorry for leading you astray Joshua. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: How 'if not exists' implemented in MySQL?
Stored procedures are MySQL are real new so I don't have much experience with them yet. The manual does seem to include some good info but I haven't delved too deeply. MaxDB is actually a separate DB. It is a re-brand of SAP DB. You might look for SAP DB info. It would probably apply to MaxDB. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: How to find if the value returned is numeric
That depends on what language you are using to return the query results. Visual Basic is an IsNumeric function. I'm sure other languages have something similiar. What are you using? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: [mysql] Dump table _files_ to a text file?
Just copy the database folder to your new server. If they are not corrupt then they should be accessible from your new server. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Multiple sums in one query
Are you wanting to do this in one query? You could put an order by on your second query. The first row returned by it should be what you are after. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Multiple sums in one query
Sorry, I didn't look closely enough at your two queries. I don't believe that you will be able to get your desired results from one query. Besides it is usually better to execute 2 queries that are simplier than one that is very complex. Robert Rowe --- Aleksander Wang-Hansen [EMAIL PROTECTED] wrote: Yes, I want to do it in one query. And the second query I made should only return one row anyway. But I want both the value I select in my first query, and the value I select in my second query, from one query. Getting it from two isn't a problem, but I can't seem to figure out how to get it from only one query. Thanks Original Message Follows From: robert_rowe [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Multiple sums in one query Date: Wed, 7 Jan 2004 13:46:02 -0500 Are you wanting to do this in one query? You could put an order by on your second query. The first row returned by it should be what you are after. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] _ Last ned nye MSN Messenger 6.1 gratis http://www.msn.no/computing/messenger - Den korteste veien mellom deg og dine venner -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Bet the Business
I'm lead developer for a company that writes custom software for the mining industry. We support MSSQL and MySQL. I've found that from a programming aspect (VB + ADO) there is relatively little difference between MSSQL and MySQL. There is some sight syntax differences and MySQL versions 5.0 do not support stored procedures. We use the InnoDB table type for MySQL as it provides row level locking and transactions. Our largest client has about 1 gig of data and averages 125 users. I've found that MySQL usually out performs MSSQL if you tune it properly and use good programming techniques. It is less integrated with Microsoft products though so if your clients will be accessing the data via MS Office applications then MSSQL will seem easier. We offer both platforms mainly because a lot of IT managers are convinced that Microsoft solutions are the best even when benchmarks say different. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: transaction support
Direct your developer to www.vbmysql.com. This site is dedicated to supporting developers who want to use MySQL with VB. We will be happy to help him with anything he runs into while writing your system for you. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Database Update Notification
MySQL 5.0 does support triggers. It is still alpha though. You might try using a timestamp field and polling your tables at intervals. It won't be real time but it might be close enough. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Bet the Business
soapbox Back to stored procedures for a second. I use them with MSSQL. For certain tasks they greatly improve performance because I don't have to move all the data client side. For the vast majority of tasks though stored procedures yeild little performance gain. I've seen systems that (designed as Microsoft suggests) wrapped all SQL usage in stored procedures. This is nonsense. Also, stored procedure have two very important liabilities: they break the n-tier model and they expose source code to the customer (if you sell your app). If you change your back end then you get to re-write all your stored procedures (I had to do this once). I routinely get calls from IT managers who have looked at my stored procedures and have questioned why I did so and so. This forces me to research it and come up with a reasonable answer. In my opinion the performance gain of stored procedures are rarely worth the headaches so their lack of them in MySQL is really not a problem. Will I use them in MySQL 5.0? Probably, but only when justified. /soapbox -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Help with Query
Try single quotes around instead of double quotes. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Escaping single quotes
You could always write your own function to do the escaping for you. This following link is an example written in VB that you could adapt to whatever language you are using. http://www.vbmysql.com/samplecode/stripquote.html Here is another way of doing it if you can link to the libmySQL.dll (or equivilent in your OS). http://www.vbmysql.com/samplecode/mysql_escape_string.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: struggling newbie - datetime or timestamp problem
Your easiest route would be to make createddate a DATETIME field and update it yourself when you insert a record. You can then make updateddate a TIMESTAMP and let MySQL set it to NOW() automatically for you by not specifying it in any of your insert or update queries. If you made them both timestamps then both fields would get updated as the record changes. Play with it some and you'll see how it behaves. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: newbie FTP question
If you are using the MyISAM table type and have FTP access to the MySQL data folder then you can just upload the database folder to your server. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Table: NULL (yes or no)
Null means no data entered. If Null is allowed and you don't specifically set a field to a value then it will be Null. If Null is not allowed then the field will be assigned its default value unless you specifically set it to something during an insert. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Binary Log replay utility?
I would greatly appreciate your notes if you are willing to post them. I'm currently preparing for the core exam. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: connecion error
It sounds like you need to set up your security permissions. See the section of the manual on grant: http://www.mysql.com/doc/en/GRANT.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Extracting images from blob fields.
You need to select into dumpfile instead of outfile. See the section of the manual on select syntax: http://www.mysql.com/doc/en/SELECT.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Importing dates from access
If your MySQL field is date or datetime then MySQL will store whatever date your put in the field. If you use a timestamp field then MySQL will set this field to the current datetime on an insert or update unless you specifically set it to something. See this section of the manual for more information. http://www.mysql.com/doc/en/DATETIME.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Oracle nvl function equivalent.
What does nvl do? Here is a list of the functions from the MySQL manual: http://www.mysql.com/doc/en/Function_Index.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Help:)
Issuing this command: mysqlSET PASSWORD FOR 'root'@'localhost' = PASSWORD xx set your password to xx You will need to use mysql -u root -p xx from the local machine to get access with the root user. This: mysql -u root -p is specifying a blank password. I believe that this: mysql -u root will prompt you for the password without echoing it to the screen. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Subtracting date fields
Just try to access the databases with the permissions that you had previously set up. If you can then it worked okay. If you can't then use grant to set your permissions up again. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: LOAD DATA INFILE
Both your client and your server must have the local flag turned on. Check phpMyAdmin to see if there is an option to turn this on for the client side. I use ADO/ODBC and I have to create a my.cnf file on the client machine with local infile=1(ON) in the [client] section and tell the ODBC driver to use local settings. The PHP API surely has something similar. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Alter table and setup Default value
This worked for me: ALTER TABLE `test` CHANGE `somefield` `somefield` enum('new','used') DEFAULT 'new' -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Broadcast to search available MySQL Server in Network?
Have you tried this code using: hostaddr.sin_port :=htons(3306); I've never done this but the code looks like it is checking the appropriate port on all machines found. See what happens when you use the MySQL default port. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: my.cnf
The correct entries for your my.cnf will vary depending on which features that you want to support. There is no standard contents. See the manual for the chapters on installation, configuration and optimization. Most distributions come with sample cnf files called: my-huge.cnf, my-large.cnf, my-medium.cnf and my-small.cnf. Where they will be located will vary depending on the distribution but they shouldn't be too hard to find. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Trouble With Counting New Documents With Complex Query
One other thing to check is that there are indexes on the fields in the other tables that you are joining to. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Cannot connect on the internet...Do I need to open a port on my router?
If remote clients will connect directly to your MySQL server then you will need to open port 3306. If you are only going to access MySQL via server side scripts (PHP) then you will not need to open this port as the scripts will connect to the localhost. If you cannot see your web site then it sounds like a configuration problem with Apache. You might check your Apache config file. You might also check your firewall and router settings to make certain that port 80 is open. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Load Data Local Infile problem
This is from the manual. See the 3rd paragraph. The REPLACE and IGNORE keywords control handling of input records that duplicate existing records on unique key values. If you specify REPLACE, input rows replace existing rows (in other words rows that has the same value for a primary or unique index as an existing row). See section 6.4.7 REPLACE Syntax. If you specify IGNORE, input rows that duplicate an existing row on a unique key value are skipped. If you don't specify either option, the behavior depends on whether or not the LOCAL keyword is specified. Without LOCAL, an error occurs when a duplicate key value is found, and the rest of the text file is ignored. With LOCAL, the default behavior is the same as if IGNORE is specified; this is because the server has no way to stop transmission of the file in the middle of the operation. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: SORTing / LIMITing on max(fieldname) blah-blah
One thing that I see is that you are using an alias in your where clause. From the manual: It is not allowed to use a column alias in a WHERE clause, because the column value may not yet be determined when the WHERE clause is executed. See section A.5.4 Problems with alias. The other thing that I see is that Max() is an aggregate function and that you do not have a group by clause. I would think that this query wouldn't run at all. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: SORTing / LIMITing on max(fieldname) blah-blah
Or you could use a subquery: SELECT id, image, width, height FROM images WHERE reference_number=(Select max(id) From images) ORDER BY image -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySql died a hard death after using grant and won't restart
You might consider using Grant instead of editing the permissions table manually. Follow this link for the appropriate section of the manual: http://www.mysql.com/doc/en/GRANT.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: plz help a newbie
Here is a link to the MySQL manual. Lots of good info here. http://www.mysql.com/documentation/mysql/bychapter/index.htm l The max size of a varchar is 255 characters. You will want to use one of the text data types if you are going to store long articles. I suggest mediumtext. You can find the exact maximum sizes in the manual under the data types section. A timestamp column gets automatically updated to now on inserts and updates unless you explictly set it to something. Datetime fields just store a datetime (you update them to whatever you want). I don't understand what you meant by this. Can you give an example? I have these type of associations supported by mysql 1:1 1:1 (Non-Identyfying) 1:1 (Descendent Obj.) What are the differences among them? Especially the last one? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Index before or after inserts?
If you are using the Load Data function then it doesn't matter. Load Data turns indexing off and then rebuilds them at the end. If you are using normal inserts then add the indexes after the import. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]