@Phil's Answer and @Mr.Brownstone's Answer should suffice for your question, so +1 for both of them.
For the following, let's assume you are logging in with username myuser
Once you have connected to mysql, you should run the following query:
SELECT USER(),CURRENT_USER();
- USER() reports how you attempted to authenticate in MySQL
- CURRENT_USER() reports how you were allowed to authenticate in MySQL
Sometimes, they are different. This may give you insight into why you are allowed to login to mysql.
Here is another query you need to run:
SELECT CONCAT('''',user,'''@''',host,'''') dbuser,password
FROM mysql.user WHERE user='myuser';
This will show you the ways in which you are allowed to login as myuser
.
If you see 'myuser'@'localhost'
, then you can authenticate from within the DB Server.
If you see 'myuser'@'127.0.0.1'
and do not see 'myuser'@'localhost'
, then you can authenticate from within the DB Server again but you must specify the --protocol=tcp
from the command line.
If you see 'myuser'@'%'
, then you can do remote logins from any server.
If you see 'myuse'r@'10.20.30,%'
, then you can do remote logins only the from 10.20.30.% netblock.
Once you see what 'mysql.user' has for your user, you may want to allow or restrict myuser from logggin in one way and not the other.
If you simply want to check if the password for myuser
is whateverpassword
, you can do the following:
SELECT COUNT(1) Password_is_OK FROM mysql.user
WHERE user='myuser'
AND password=PASSWORD('whateverpassword');
You can check from the command line as follows:
PASSWORDISOK=`mysql -uroot -p... -ANe"SELECT COUNT(1) Password_is_OK FROM mysql.user WHERE user='myuser' AND password=PASSWORD('whateverpassword')"`
If you are not root
and want to test myuser only, you can do this:
PASSWORDISOK=`mysqladmin -umyuser -pwhateverpassword ping | grep -c "mysqld is alive"`
If you get 1, password for myuser is verified as good.
You apparently have a missing drupal_install_test
in your database schema. As the name says, it's a test table that is created at installation time to test the performance of the database and of the database user you provided for your site. At the end of the installation process, it gets dropped from the database.
The problem here is that the table has been dropped but mysql still thinks it exists. The reason why that table has remained in information_schema.tables
should definitely be investigated and may reflect some issues in the database or in your server's configuration.
That said, if drupal_install_test
is the only corrupted table in your database, you can try and drop it and proceed with your backup. I recommend that you make a full backup of the mysql data directory (in a typical linux installation /var/lib/mysql
) and issue a DROP TABLE drupal_install_test
command. Mysql should be able to restore the integrity of the schema tables and you should be able to proceed with your backup.
Best Answer
Add
-e
option:Test:
EDIT 2:
If you want to avoid the query header (
column_name
), use--skip-column-name
: