You may have been unaware of this, but everything and its grandmother done in MySQL is a question.
In light of this, the real question is : To mysqld, what is a Question ?
According to the MySQL Documentation on Questions:
The number of statements executed by the server. This includes only statements sent to the server by clients and not statements executed within stored programs, unlike the Queries variable. This variable does not count COM_PING, COM_STATISTICS, COM_STMT_PREPARE, COM_STMT_CLOSE, or COM_STMT_RESET commands.
Anything you issue for the sake of running queries or just checking a status of some kind is a Question. Even checking how many questions in your session is itself a Question. Here is proof: (I will connect to MySQL 5.6.14 for Windows and ask for Questions in my session):
Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.
C:\Windows\system32>mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.14 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show status like 'Questions';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Questions | 3 |
+---------------+-------+
1 row in set (0.11 sec)
mysql> show status like 'Questions';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Questions | 4 |
+---------------+-------+
1 row in set (0.00 sec)
mysql> show status like 'Questions';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Questions | 5 |
+---------------+-------+
1 row in set (0.00 sec)
mysql>
This is normal to expect, so there is really nothing to worry about.
YOUR ORIGINAL QUESTIONS
Is someone hacking my database?
No, you are not being hacked.
Is PHPMyAdmin reporting inaccurate information?
PHPMyAdmin asks mysqld Questions all day long. The result is that it just runs up the global count (As seen from SHOW GLOBAL STATUS;
). I wrote an answer to a post in ServerFault about 2.5 years ago entitled 1 billion mysql queries in 24 days? Can something be wrong?. I attributed the runaway stats to monitoring then, and I still strongly assert this now.
Best Answer
If you have downloaded the database as an SQL file then you can just import it using the command prompt and the mysql command.
Do it in these simple steps:
# mysql -p -u username database_name
. You'll be asked for password and, if correct, you'll be accepted to your database.create database MyNewDatabase;
# mysql -p -u username database_name < /tmp/download/db_backup.sql
. Make sure you're not inside the MySQL command prompt but out in the normal command prompt when typing this command. You can simply typeexit
orquit
to leave the MySQL command prompt.Some things to think of:
root
is the username to use. But it's always recommended to add a separate user account in MySQL that you can use from scripts ect.use someotherdb;
thensomeotherdb
will be used instead of the database name you specify in themysql
command. To get around this, either open up the SQL backup file and remove the first line withuse
, or, when you create your backup, untick the box sayingInclude using
(or something similar).