mysql

GROUP BY and uniqueness in multiple columns

Lets say that I am looking to select 3 columns from a few joined tables: event_id, home_team, and the results of an aggregate function. The event_id is a primary key autoincremented. The home_team is not unique to every record in the table. I want to group by event_id to generate the aggregate function and then sort by the reuslts of...

Disable MySQL general logging without restarting?

Can I disable general logging completely without restarting the server? Because, per the documentation: SET sql_log_bin = {0|1} Disables or enables binary logging for the current connection (sql_log_bin is a session variable) if the client has the SUPER privilege. The statement is refused with an error if the client does not have tha...

MySQL Text Column being truncated.

I have a MySQL database in which I am storing a bunch of textual info into a Text field in the database. The columns is Name: info Type: text Collation: utf8_general_ci I had a user insert ~64kb of information into the field and it freaks out. It will truncate the last 3 characters off. Which in this case happen to be the ending to a ...

SQL Rights Creator/Owner

Our software has data to store, so it also install MYSQL, a root user and a user with read only access if a third party compagny wants to install a backup solution for our data. But the third party wants to write data (a timestamp for backup purpose or something like that...) to another database. How can I change the user so it has read ...

Does this code deletes duplicates?

I want to use this to get data from row out of mysql database into text files (one entry under another, 50 entries per file): $ mysql --user=XXX --password=XXX --batch --skip-column-names \ -e "SELECT userid, displayname FROM Users" stackoverflowdb | \ split -l 50 -a 5 - "result." but I also don't want to copy duplicate entries to th...

How to run WPF XBAP app on my intranet?

I have a Debian server with a standart Apache and a MySQL. I will host there my xbap app. I want to create a application that access that MySQL and can be seen in my intranet in firefox. It's possible? How? And about the trust not granted message? Suggestions will be great. Thankz! ...

Website Here, Linking to Database There on other Server?

Is it possible to link to a MySql database that is on another server and hosted somewhere else entirely? ...

LEFT JOIN with more fields in the right table

I have a problem! My shops table contains 4 rows, each containing a shop name, ID and other data relevant to that shop. I also have a "bind" table where I select which product categories should be visible in which shops. Naturally the bind table will contain more rows... I would like to select all the shops from the shops table, and joi...

What is the Big-O for SQL select ?

What is the Big-O for SQL select, for a table with n rows and for which I want to return m result? And What is the Big-O for an Update, or delete, or Create operation? I am talking about mysql and sqlite in general. ...

MySQL - How do I get a range from the point closest to start?

Table structure- int PrimaryKey DateTime Date int Price What I would like to do is pass in a start and end date, and get the range From: The greatest date that is less than or equal to start UNLESS there is no such date, in which case the start of the range should be the lowest date available. To: The end date. My query so far i...

MySQL - How to refer to server as http path?

I am trying out WebIssues link text which allows for a client-server issue tracker. I have setup the MySQL database required. The problem is that the client program wants a 'Server URL' in order to connect to the database. Normally on my network I just refer to the servername and/or databasename. How do I provide a http style path to...

Order by null first, then order by other variable

Hi, this is my code for now: SELECT id, number FROM Media WHERE user = 10 ORDER BY id, number but I want it to look like: SELECT id, number FROM Media WHERE user = 10 ORDER BY while(number IS NULL), id What I want to do is to have all number that are NULL on the top of the result, but as soon number is not NULL, sort by id Is that...

bash/mysql complains about ) character

I'm trying to execute this: $ mysql --user=XXX --password=XXX --batch --skip-column-names \ -e "SELECT userid, displayname FROM Users" stackoverflowdb | \ split -l 50 -a 5 - "result." but bash complains about ) 'unexpected' character (i have this character and few other 'weird ones' in my mysql password). I tried to take my password ...

Complex SQL query in MySQL

Hello, I have the following tables in the database: bands - band_id - band_name albums - album_id - album_name - album_owner songs - song_id - song_name - song_owner ratings - rating_id - rating_value - rating_song Tables "albums" and "songs" relate to "band_id" from table "bands" by "album_owner" and "song_owner". Table "r...

MySQL InnoDB tables corrupt -- how to fix?

Hello all, While performing a conditional DELETE operation in one of my InnoDB tables, which apparently required some temporary table to be created in ibdata1, the hard disk filled up and mysql crashed. I couldn't get it to start again until I deleted the ibdata1 file (~30 GB). Now mysql starts again, but all the tables in the database...

How does PHP communicate with MySQL on the same server

Hey! Does anyone know how php requests data from mysql? If I have mysql in the same machine as php, does it open a tcp connection to the localhost on port 3306 or does it have some other way of getting the data? Is it the same in linux and windows? Thanks ...

importing mysql file into access DB

i need to import a mysql file into my access db. how do i do this? here's a sample of the mysql file: * MySQL Data Transfer Source Host: 10.0.0.5 Source Database: jnetdata Target Host: 10.0.0.5 Target Database: jnetdata Date: 5/26/2009 12:27:33 PM */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for chav...

security holes in xampp for windows?

i need to install a mysql server on my windows machine to run a local database. does anyone know if this thing poses a vulnerability? ...

i have xampp mysql server running, how do i run code?

i need run code that will create a database and populate tables. i am using windows. how can i run this code? localhost/phpmyadmin shows nothing, it's a blank page could it be because i installed the lite version? ...

running sql code with microsoft sql 2008

i have about 8mb of sql code i need to run. it looks like this: /* MySQL Data Transfer Source Host: 10.0.0.5 Source Database: jnetdata Target Host: 10.0.0.5 Target Database: jnetdata Date: 5/26/2009 12:27:33 PM */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for chavrusas -- ---------------------------- ...