mysql

how to use cursor for reading multiple files in database in python

In python how to read multiple files from mysql database using cursor or loop one by one and store in separate table ...

Bitwise Flags abandoned ?

I've noticed that plenty of opensource project doesn't use BITWISE flags anymore, even if it's fully supported by programming enviroment common for web ( php/Mysql). It's that a "lost practise" for some effective problem, or is just that a lot of php programmers don't know how to handle this type of implementation? Nothing too important...

Insert firelog into mysql

Hi, im interesting of inserting firewall log which im printing to the stdout to mysql database as well. the line output is: 16:51:56 drop Nova <eth0 Attack Info: MS Word cascading style sheet vulnerability detected (MS08-026); attack: Content Protection Violation; viola profile: Default_Protection; src: udis; dst: Nova; proto: tcp...

Are there any pitfalls / things you need to know when changing from MyISAM to InnoDB

One of my projects use the MyISAM engine in MySQL, but I'm considering changing it to InnoDB as I need transaction support here and there. What should I look at or consider before doing this? Can I just change the engine, or should the data be prepared for it? ...

Compare two MySQL databases

I have a database in MySQL that I am currently developing. I have a copy of this database on my development machine which I modify as fast as I develop and a copy on a test server. My question is: Is there a way to compare the two instances of the database to see if there was any changes? Its not a real problem to simply re-deploy the ...

How do insert data into two different tables?

I have a form which takes both the user details and an image uploaded by them. I want to write the data to a user table and an image table but i am pretty sure that it cannot be done with just two separate insert statements. Any help would be much appreciated. ...

Can Someone Explain MySQL's License and What it Means to Closed Source Development?

Is it necessary to have a commercial license for MySQL in order to use it legally in a project which is not open source? Does it matter if the application is hosted and the binaries are never distributed? The more I learn about open source licenses the more confused I become. ...

How do I repair an InnoDB table?

We (apparently) had poorly executed of our Solaris MySQL database engine last night. At least some of the InnoDB tables are corrupted, with timestamp out of order errors in the transaction log, and a specific error about the index being corrupted. We know about the tools available for MyISAM table repairs, but cannot find anything for I...

mysql replication - table locking?

I am currently working for a company that has a website running mysql/php (all tables are also using the MYISAM table type). We would like to implement replication, but I have read in the mysql docs and elsewhere on the internet that this will lock the tables when doing the writes to the binary log (which the slave dbs will eventually r...

array compiling from mysql help required.

Hi This has been bugging me, I can't get my head around it. I will use the foodstuffs analogy to try and simplify my probelm. 1000 members of the public where asked to pick a variety from each of 13 categories of footstuff. These selections were then stored in a mysql database against their name. e.g. billy mary etc. etc. mi...

Apart from initial cost, are there any other benefits of using MySQL over MSQL server with .net?

I've used both and I've found MySql to have several frustrating bugs, limited support for: IDE integration, profiling, integration services, reporting, and even lack of a decent manager. Total cost of ownership of MSSQL Server is touted to be less than MySQL too (.net environment), but maintaining an open mind could someone point out any...

In What Order are MySQL JOINs Evaluated

I have the following query: SELECT c.* FROM companies AS c JOIN users AS u USING(companyid) JOIN jobs AS j USING(userid) JOIN useraccounts AS us USING(userid) WHERE j.jobid = 123; I have the following questions: Is the USING syntax synonymous with ON syntax? Are these joins evaluated left to right? In other words, does this query sa...

NULL in MySQL (Performance & Storage)

What exactly does null do performance and storage (space) wise in MySQL? For example: TINYINT: 1 Byte TINYINT w/NULL 1 byte + somehow stores NULL? ...

How do I cleanly extract MySQL enum values in Perl?

I have some code which needs to ensure some data is in a mysql enum prior to insertion in the database. The cleanest way I've found of doing this is the following code: sub enum_values { my ( $self, $schema, $table, $column ) = @_; # don't eval to let the error bubble up my $columns = $schema->storage->dbh->selectrow_hashr...

dbmetal visual metal error:"magma string must not be empty"

i am just trying to generate the classes for linq to mysql with dbmetal / visual metal and keep running into the error: "magma string must not be empty"... i've googled, i've recompiled locally, checked the references etc. and don't really want to start debugging this... anybody had the same issue before or knows of another way to genera...

How To Create A 'Two-Sided' Unique Index On Two Fields?

How can I efficiently create a unique index on two fields in a table like this: create table t (a integer, b integer); where any unique combination of two different numbers cannot appear more than once on the same row in the table. In order words if a row exists such that a=1 and b=2, another row cannot exist where a=2 and b=1 or a=1 a...

Migrate table from MS SQL Server to MySQL

Hello, I have to migrate a table from MSSQL Server to MySql. The problem is that the table is quite big (65 millions records) and the whole process takes too much time. Does anyone have any idea how to speed things up ? Any useful tools that could improve this? ...

TRIGGERs that cause INSERTs to fail? Possible?

In cleaning up this answer I learnt a bit about TRIGGERs and stored procedures in MySQL, but was stunned that, while BEFORE INSERT and BEFORE UPDATE triggers could modify data, they seemingly couldn't cause the insert/update to fail (ie. validation). In this particular case I was able to get this to work by manipulating the data in such ...

Sanitizing MySQL user parameters.

What are the dangerous characters that should be replaced in user input when the users' input will be inserted in a MySQL query? I know about quotes, double quotes, \r and \n. Are there others?(I don't have the option of using a smart connector that accepts parameters so I have to build the query myself and this will be implemented in mu...

Copying rows in MySQL

I want to copy all of the columns of a row, but not have to specify every column. I am aware of the syntax at http://dev.mysql.com/doc/refman/5.1/en/insert-select.html but I see no way to ignore a column. For my example, I am trying to copy all the columns of a row to a new row, except for the primary key. Is there a way to do that wit...