Hello
I have a local mysql server (MySQL 5.0)
I would like to create a new database in the server (called app) and to create a user account that will have the right to connect to that database.
I running the following code in order to set up the account:
// create the new database:
$connection = mysql_connect("localhost", "root", "", MYSQL_CLIENT_COMPRESS);
mysql_query("CREATE DATABASE IF NOT EXISTS app;", $connection);
// set up the second account:
mysql_query("GRANT LOCK TABLES, SELECT, UPDATE, INSERT ON app.* TO 'user'@'%' identified by 'password';", $connection);
mysql_query("GRANT LOCK TABLES, SELECT, UPDATE, INSERT ON app.* TO 'user'@'localhost' identified by 'password';", $connection);
mysql_query("FLUSH PRIVILEGES;", $connection);
Next I try to perfrom the following code:
$connection = mysql_connect("localhost", "user", "password", MYSQL_CLIENT_COMPRESS);
But I get the following error:
Client does not support authentication protocol requested by server; consider upgrading MySQL client
Is this the right way to create an account?
Why is the code failing?
I am trying to connect from the localhost to the server.
thanks in advance