tags:

views:

46

answers:

2

I get the error "Table 'mysql.servers' doesn't exist" from plesk when I try to create a new database user, the created user does not show up anywhere but the name is still reserved, and it does not allow me to access the database.

edit: I was unable to login to phpMyAdmin to this webserver, so instead I managed to login to it through a different domain, and it tells me a notice: Your PHP MySQL library version 5.0.90 differs from your MySQL server version 5.1.49. This may cause unpredictable behavior.

edit: manually installed phpmyadmin then manually installed libmcrypt (which is an accomplishment with my cruddy sever skills :D) so that phpmyadmin works. Then accidentally found out how to login as root via plesk (the trick is to enter webadmin without choosing any database), at least I think it's root :S ran the sql: GRANT SELECT ON mysql.* TO 'my-user'@'localhost'; with a success message went back to plesk to see if I can manage the sql with "my-user" and no, its still missing from the available users, but the name is still reserved... tried to run: mysql_fix_privilege_tables –user=root –password=mypasswordobviosuly –verbose but gave and error, and i'm still not sure how to run direct mysql commmands without using ssh (because i dont know the root password)

+1  A: 

It looks like your user does not have access to the mysql database. You may want to grant the SELECT command as follows:

GRANT SELECT ON mysql.* TO 'your-user'@'localhost';
Daniel Vassallo
how would I run this on the external server?
YuriKolovsky
@YuriKolovsky: How do you access your MySQL server? Do you have root access? Are you using something like phpMyAdmin?
Daniel Vassallo
yes phpMyAdmin it is, which is not letting me access it saying there are no users :S
YuriKolovsky
@YuriKolovsky: Can you log in with root in phpMyAdmin? If yes, do so, and execute `GRANT SELECT ON mysql.* TO 'your-user'@'localhost';` You'd have to substitute the `your-user` bit with the username you're using in your application.
Daniel Vassallo
I found out that to login as root I need to manually install phpmyadmin, and I did so, but thanks to my complete inexperience with servers I can't get it to work, phpMyAdmin just throws "Cannot load mcrypt extension"
YuriKolovsky
@YuriKolovsky: Do you have access to the server via ssh? If so you can probably log into mysql using `mysql -u root -p` and then grant the select privileges to your user as described in my answer.
Daniel Vassallo
I don't seem to know the mysql root password... but I managed to login with plesk as the root user and run the above command, it returned success but did not help the situation as the user i created earlier is still missing... but its name is reserved...
YuriKolovsky
@YuriKolovsky: The `GRANT` command will return successfully even if the user does not exist. By the way, did you try an empty password for root? I think that is the default one.
Daniel Vassallo
thanks for that tip, i will keep that in mind :P. no, empty did not work.
YuriKolovsky
but now i solved the problem, what should I do with your help even though it was not the solution? should I post my own solution as the solution?
YuriKolovsky
@YuriKolovsky: Yes, feel free to post a new answer and accepting it. I'm glad you solved the problem :)
Daniel Vassallo
thanks for the moral assistance, it is more appreciated than you think, as i solved it trying to find a way to run your sql :D
YuriKolovsky
@YuriKolovsky: No probs :) ... You may want to post the solution as an answer, instead of as part of the question. It's an acceptable way to post solutions to own questions.
Daniel Vassallo
A: 

I entered mysql via pre-installed phpmyadmin as 'root' like so: (in plesk) home-> database servers -> webadmin. Then choose the "mysql" database, if the table 'servers' is missing (probably some mysql bug) then it will need to be created: choose 'SQL' in 'phpmyadmin' to and run the following sql:

CREATE TABLE `servers` (
`Server_name` char(64) NOT NULL,
`Host` char(64) NOT NULL,
`Db` char(64) NOT NULL,
`Username` char(64) NOT NULL,
`Password` char(64) NOT NULL,
`Port` int(4) DEFAULT NULL,
`Socket` char(64) DEFAULT NULL,
`Wrapper` char(64) NOT NULL,
`Owner` char(64) NOT NULL,
PRIMARY KEY (`Server_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table';

so that the table at least exists... then create a new user in plesk, and viola! it works! I was able to login as the user I created after that, it seems like it was some bug with some mysql update I did not even know about.

YuriKolovsky