Adding user to MySQL

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
ThatBum
A regular
A regular
Posts: 35
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Fri May 20, 2011 3:01 pm

Adding user to MySQL

Post by ThatBum »

Heya. I just put phpMyAdmin up to check up on the databases for the wiki and web bans system I have running on my webspace. Though, it says to enable extended functions and saving preferences, I need to make another SQL user that has limited privileges to a seprate DB. Well, I made one, tntspacebuild_phpmyadmin, and tried to run this series of queries on it:

Code: Select all

GRANT USAGE ON tntspacebuild_phpmyadmin.* TO 'pma'@'localhost' IDENTIFIED BY '[redacted]';
GRANT SELECT (
    Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,
    Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,
    File_priv, Grant_priv, References_priv, Index_priv, Alter_priv,
    Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv,
    Execute_priv, Repl_slave_priv, Repl_client_priv
    ) ON tntspacebuild_phpmyadmin.user TO 'pma'@'localhost';
GRANT SELECT ON tntspacebuild_phpmyadmin.db TO 'pma'@'localhost';
GRANT SELECT ON tntspacebuild_phpmyadmin.host TO 'pma'@'localhost';
GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)
    ON tntspacebuild_phpmyadmin.tables_priv TO 'pma'@'localhost';
However, it throws this on the first line:
#1044 - Access denied for user 'tntspacebuild'@'localhost' to database 'tntspacebuild_phpmyadmin'

It happens both in phpMyAdmin, and in the mysql CLI program from SSH. I'm not too handy with SQL, I might just be being a derp, thought it seems like my user can't make other users. Is this the case, and should I just plug in the tntspacebuild user into the config storage field?

What I'm trying to do: http://www.phpmyadmin.net/documentation/#linked-tables
User avatar
TimeX
Staff
Staff
Posts: 1733
Joined: Thu Jul 22, 2004 12:24 am
Location: Big Bear, CA

Re: Adding user to MySQL

Post by TimeX »

On our web hosting, creating databases from inside phpmyadmin and the like will not work, they can only be created from the "Databases" page in the control panel, and all are set to the same user.
TimeX
ThatBum
A regular
A regular
Posts: 35
Joined: Fri May 20, 2011 3:01 pm

Re: Adding user to MySQL

Post by ThatBum »

Well, yeah, the DB already exists, it's tntspacebuild_phpmyadmin. It was made with the CP.

If it were creating a DB it would have something like "CREATE DATABASE IF NOT EXISTS `tntspacebuild_phpmyadmin`" in it.

phpMyAdmin can connect to it fine, I can see the tables I imported into it, but it's just that GRANT does not work.
User avatar
Edge100x
Founder
Founder
Posts: 12962
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: Adding user to MySQL

Post by Edge100x »

GRANT requires administrative privileges, which you do not have, so it should always fail.

We only allow one MySQL user per website account currently.
ThatBum
A regular
A regular
Posts: 35
Joined: Fri May 20, 2011 3:01 pm

Re: Adding user to MySQL

Post by ThatBum »

Alright, fine with me. Just wanted to know why it was failing. It's not totally essential to have the extended features in phpMyAdmin, I mainly use it for imports anyway.
Post Reply