Questions tagged [mysql]
MySQL is a free, open-source Relational Database Management System (RDBMS) that uses Structured Query Language (SQL). DO NOT USE this tag for other DBs such as SQL Server, SQLite etc. Those are different DBs that all use their own dialects of SQL to manage the data. Always specify the exact version of the server in the question. Note that configuration/setup-related questions are off-topic on stackoverflow.
mysql
662,199
questions
3
votes
2
answers
234
views
Is having different users for different types of queries a good practice?
I am using MySQL and PHP for a project I am working. I have created separate users for carrying out different functions (one for running select queries, one for running update queries, etc.) to ...
79
votes
31
answers
162k
views
Loading .sql files from within PHP
I'm creating an installation script for an application that I'm developing and need to create databases dynamically from within PHP. I've got it to create the database but now I need to load in ...
51
votes
5
answers
65k
views
MySQL Row Format: Difference between fixed and dynamic?
MySQL specifies the row format of a table as either fixed or dynamic, depending on the column data types. If a table has a variable-length column data type, such as TEXT or VARCHAR, the row format is ...
2
votes
3
answers
446
views
What is MySQL mostly doing?
Is there any way to see an overview of what kind of queries are spent the most time on every day on MySQL?
2
votes
7
answers
3k
views
Delete all but the 50 newest rows
I have a SQL table with news stories and Unix timestamps. I'd like to only keep the 50 newest stories. How would I write an SQL statement to delete any amount of older stories?
3
votes
4
answers
620
views
Best way to search in a table and get results and number of results (MySQL)
I have a table of "items", and a table of "itemkeywords".
When a user searches for a keyword, I want to give him one page of results plus the total number of results.
What I'm doing currently is (for ...
2
votes
2
answers
4k
views
Best way to validate user input JDBC?
Is there a built-in way to escape user input in java using the JDBC? Something similar to the php version mysql_real_escape() function. What's the best way to validate input?
2
votes
3
answers
311
views
Can I make Hibernate transparently avoid string duplication in the database?
I have a Java program that uses Hibernate and MySQL to store a lot of tracing data about the use of the Eclipse IDE. This data contains a lot of strings such as method names, directories, perspective ...
2
votes
4
answers
2k
views
How can I be sure the whole MySQL DB is loaded in memory?
I am running a mysql server. I would like to somehow make sure that the whole DB is loaded into the ram as I heard it would be alot faster.
Is this true? and how do I vertify it?
3
votes
5
answers
378
views
How would you handle a very large vector in Ruby?
I'm planning to write a program in Ruby to analyse some data which has come back from an online questionnaire. There are hundreds of thousands of responses, and each respondent answers about 200 ...
15
votes
3
answers
17k
views
varchar(255) v tinyblob v tinytext
My side question is there really any difference between tinyblob & tinytext?
Buy my real question is what reason, if any, would I choose varchar(255) over tinyblob or tinytext?
15
votes
6
answers
27k
views
MySQL and data file encryption
Is there a way to encrypt the data file that mysql uses? I have a mysql server on an open machine, and I would like to encrypt the data file so even if someone copies the data files, they cannot read ...
128
votes
10
answers
68k
views
Comparing date ranges
In MySQL, If I have a list of date ranges (range-start and range-end). e.g.
10/06/1983 to 14/06/1983
15/07/1983 to 16/07/1983
18/07/1983 to 18/07/1983
And I want to check if another date range ...
9
votes
0
answers
2k
views
What is the best way to pick a random row from a table in MySQL? [duplicate]
Possible Duplicate:
quick selection of a random row from a large table in mysql
I have seen random rows pulled using queries like this, which are quite inefficient for large data sets.
SELECT ...
14
votes
10
answers
6k
views
Which database has the best support for replication
I have a fairly good feel for what MySQL replication can do. I'm wondering what other databases support replication, and how they compare to MySQL and others?
Some questions I would have are:
Is ...