ChrisMartino Posted January 20, 2011 Share Posted January 20, 2011 Hey there I'm having a strange error here. So basically I'm running the following command: It creates the MySQL user and MySQL database fine but the last permission grant fails. $mysql_connection = mysql_connect($remote_machine['Machine_IP'], $remote_machine['Machine_MySQL_Username'], $remote_machine['Machine_MySQL_Password']); mysql_query("CREATE DATABASE Server_{$server_id}", $mysql_connection); mysql_query("CREATE USER 'Server_{$server_id}'@'localhost' IDENTIFIED BY '{$database_password}'", $mysql_connection); mysql_query("GRANT ALL PRIVILEGES ON Server_{$server_id}.* TO Server_{$server_id}@localhost IDENTIFIED BY '{$database_password}';", $mysql_connection) or die(mysql_error()); But for some reason when I grant the privileges on the last command there I am prompted with the following error: Access denied for user 'root'@'ciroc.x10premium.com' to database 'Server_25' Any ideas? Thanks. Link to comment https://forums.phpfreaks.com/topic/225130-errors-with-mysql/ Share on other sites More sharing options...
Maq Posted January 20, 2011 Share Posted January 20, 2011 Please, if you have a MySQL, put it there. I'll move it this time. Link to comment https://forums.phpfreaks.com/topic/225130-errors-with-mysql/#findComment-1162772 Share on other sites More sharing options...
fenway Posted January 26, 2011 Share Posted January 26, 2011 Your username & host for the grant must be quoted as string literals. Link to comment https://forums.phpfreaks.com/topic/225130-errors-with-mysql/#findComment-1165439 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.