How can I restore a mysql database that was dropped using a "drop database" command? I have access to binary logs which should make this type of rollback possible.
I am getting "ASCII encoding" errors when I insert into my database because I did a fresh install of the MYSQL.
I'd like to change the default to UTF-8 again.
I am creating application for MAC using cocoa framework, I would like to know how and what are the ways i can connect to MySql database using cocoa framework.
What are the most efficient SQL queries that would take an existing MySQL table and re-sort it by one of the columns? Not a selection, but the whole table should be sorted by one column. Somehow using a temporary table, I guess, but what's the best way?
I am generating tables from classes in .NET and one problem is a class may have a field name key which is a reserved MySQL keyword. How do I escape it in a create table statement? (Note: The other problem below is text must be a fixed size to be indexed/unique)
create table if not exists misc_info (
id INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
key TEXT UNIQUE NOT NULL,
value TEXT NOT NULL)ENGINE=INNODB;
I have a MySQL query that:
gets data from three tables linked by unique id's.
counts the number of games played in each category, from each user
and counts the number of games each user has played that fall under the "fps" category
It seems to me that this code could be a lot smaller. How would I go about making this query smaller. http://sqlfiddle.com/#!2/6d211/1
Any help is appreciated even if you just give me links to check out.
is there a way to insert pics(not url,the pic)into a MYSQL table made with phpmyadmin?
and if there is when i want to get that picture and insert it in the page , what should i do? :)
Hi everybody,
Is there a "known limit" for columns & rows in a mySQL table that when passed, it can be safe to say that performance is severely affected?
I've think that I had heard that there is a "golden number" that you really dont want to exceed in either columns or rows in a table. - Or is it all about the size of the index and available RAM + CPU on the server?
Thanks!
How can i find out if there is transaction open in mySQL? I need to start new one if there is no transaction open, but i don't want to start new one if there is one running, because that would commit that running transaction.
I am generating tables from classes in .NET and one problem is a class may have a field name key which is a reserved mysql keyword. How do i escape it in a create table statement? (Note: The other problem below is text must be a fixed size to be indexed/unique)
create table if not exists misc_info (
id INTEGER PRIMARY KEY AUTO_INCREMENT NOT NULL,
key TEXT UNIQUE NOT NULL,
value TEXT NOT NULL)ENGINE=INNODB;
When stepping through a script in MySQL Query Browser's script window, is there any way to view the value of a variable I have just assigned?
Specifically I do an update on one line, and then:
SET @Num=row_count();
While debugging the script, I would like to be able to know the value of @Num
This question already has an answer here:
MySQL command appends '@localhost' to username
1 answer
Mysql - Access denied for user 'root'@'x.x.x.x' [duplicate]
7 answers
root@test-2:/usr/local# mysql -u root -H 192.168.x.xxx -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
I'm very surprised that it seems impossible to upload more than a few megabytes of data to mysql database through PHPMyAdmin whereas I can upload a msaccess table easily up to 2 Gigabytes.
So is there any script in php or anything that can allow to do so unlike phpmyadmin ?
I would like to pass a MYSQL query via Coldfusion the following date: 03/13/2010
So the query filters against it like so:
SELECT *
FROM myTable
WHERE dateAdded before or on 03/13/2010
I'd also like to be able to take 2 dates as ranges, from: 01/11/2000, to: 03/13/2010
SELECT *
FROMT myTable
WHERE dateAdded is ON or Between 01/11/2000 through 03/13/2010
thanks
I'm just getting my head around java (and OOP for that matter), the only thing I am familiar with is MySQL. I need to keep the DB connection open throughout the duration of the application, as well as a server socket.
I'm not even sure if they both need separate classes, but here's what I have so far:
http://pastebin.com/qzMFFTrY
(it wouldn't all go in a code tag)
The variable I need is con for line 86.
How do i decrypt an aes encryted column when using flash/flex to display the table data?
adobe flex connected using php connection class to mysql
for php, we would use aes_decrypt()
however i am not sure how i can get flex to do this.
Suppose I have a datetime column in MySQL.
How do I select all that have a datetime within 2500 seconds of the current datetime?
SELECT ALL where current_datetime - that_datetime < 2500 ...
This is part two of the question: http://stackoverflow.com/questions/2913639/mysql-make-this-query-faster-theres-a-way
this query still run slowly:
SELECT b.id,
b.name,
c.name
FROM bookcorr as a JOIN books as b on b.id = a.books_id =
JOIN Library as c on c.id = a.library_id
WHERE a.category_id = '2521'
AND a.library_id = '4983'
ORDER BY b.name ASC LIMIT 0,15
Any suggest ?
I want to use MySQL to store a bunch of admin settings - what's the best way to structure the table?
Like this?
Setting _|_ Value
setting1 | a
setting2 | b
setting3 | c
setting4 | d
setting5 | e
Or like this?
|--------|_setting1_|_setting2_|_setting3_|_setting4_|_setting5_|
Settings | a | b | c | d | e |
Or maybe some other way?
I am ok with mysql. when i use desc tablename i can see columns with MUL meaning it is a foreign key. Now my question is, how do i find out exactly what table and column that column is pointing to.
Hi friends,
I need to store image and resume of user in the data base.
I am using mysql data base and php5. I need to know which data types I should use.
And also how do I set a limit (maximum size) for uploaded data.
How do you query a MySQL table columns highest entry and store it in a variable. Here is what I have but it is not working.
$query = "SELECT MAX(date) FROM Records WHERE ips='$currentip'";
$result = mysql_query($query) or die(mysql_error());
echo $result;