I am installing phabricator in linux and followed the installation guide from https://secure.phabricator.com/book/phabricator/article/installation_guide/ and also from http://www.tecmint.com/install-phabricator-in-linux/
When i try to access phabricator from web url, i am getting response like
Unable to connect to MySQL!
Attempt to connect to root#127.0.0.1 failed with error #2003: Can't connect to MySQL server on '127.0.0.1' (13).
Make sure Phabricator and MySQL are correctly configured.
To update these 4 value(s), run these command(s) from the command line:
phabricator/ $ ./bin/config set mysql.host value
phabricator/ $ ./bin/config set mysql.port value
phabricator/ $ ./bin/config set mysql.user value
phabricator/ $ ./bin/config set mysql.pass value
When i configured my mysql and if i run phabricator/ $ ./bin/storage upgrade i am getting error as
[2015-01-20 18:12:04] EXCEPTION: (AphrontAccessDeniedQueryException) #1044: Access denied for user ''#'localhost' to database 'phabricator_audit' at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:301]
#0 AphrontBaseMySQLDatabaseConnection::throwQueryCodeException(integer, string) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:275]
#1 AphrontBaseMySQLDatabaseConnection::throwQueryException(mysqli) called at [<phutil>/src/aphront/storage/connection/mysql/AphrontBaseMySQLDatabaseConnection.php:181]
#2 AphrontBaseMySQLDatabaseConnection::executeRawQuery(string) called at [<phutil>/src/xsprintf/queryfx.php:6]
#3 queryfx(AphrontMySQLiDatabaseConnection, string, string) called at [<phabricator>/src/infrastructure/storage/management/PhabricatorStorageManagementAPI.php:219]
#4 PhabricatorStorageManagementAPI::applyPatchSQL(string) called at [<phabricator>/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementUpgradeWorkflow.php:109]
#5 PhabricatorStorageManagementUpgradeWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:396]
#6 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:292]
#7 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/sql/manage_storage.php:171]
If i run ./bin/storage upgrade --user root --password root i am getting error as
Raw MySQL Error: Attempt to connect to root#localhost failed with error
#1045: Access denied for user 'root'#'localhost' (using password: YES).
This is my apache settings,
<VirtualHost *:80>
ServerAdmin root#xxx.yyy.com
ServerName xxx.yyy.com
DocumentRoot /var/www/html/myprojectapp/phabricator/webroot
RewriteEngine on
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
<Directory "/var/www/html/myprojectapp/phabricator/webroot">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I have followed all the instruction provided in the installation guide. Can anyone help me to point out my mistake?
It seems that Phabricator creates a lot of phabricator_ databases so this should do the trick:
GRANT ALL PRIVILEGES ON `phabricator\_%`.* TO phabricatoruser#'localhost';
You can try to limit the privileges as well.
i had the same problem the fixing was so easy :
./bin/config set mysql.host 'localhost'
./bin/config set mysql.user 'root'
./bin/config set mysql.pass 'pass'
don't forget the "quotes" i spent 2 days for fix this issue !!
it was a selinux problem.
disabling it solves it.
1 edit this file vim /etc/selinux/config
2 change SELINUX=enforcing ---> SELINUX=disabled
3 reboot
Most likely your database user do not have create privileges.
login using mysql: mysql -u user -p
and try: create database temp;
If the database is not created then you need to grant create privileges to your user.
Check this for the mysql Grant syntax.
Ok, I just got the same issue, I fixed it after few hours :(
Seems that my password has dolar sign $ at the end.
I changed the mysql password to a simple letters and numbers, without special characters.
Strange, but this fixed the problem for me!
I did not made any additional investigations but seems to be a problem with special characters inside the mysql passwords.
Related
This question already has answers here:
php mysqli_connect: authentication method unknown to the client [caching_sha2_password]
(17 answers)
Closed 3 years ago.
I'm running MySQL version 8 on PHP 7.0.
I'm getting the following error when I try to connect to my database from PHP:
Connect Error: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
PHP might show this error
Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password] in D:\xampp\htdocs\reg\server.php on line 10
How can I fix this problem?
#mohammed, this is usually attributed to the authentication plugin that your mysql database is using.
By default and for some reason, mysql 8 default plugin is auth_socket. Applications will most times expect to log in to your database using a password.
If you have not yet already changed your mysql default authentication plugin, you can do so by:
1. Log in as root to mysql
2. Run this sql command:
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password
BY 'password';
Replace 'password' with your root password. In case your application does not log in to your database with the root user, replace the 'root' user in the above command with the user that your application uses.
Digital ocean expounds some more on this here Installing Mysql
You have to change MySQL settings.
Edit my.cnf file and put this setting in mysqld section:
[mysqld]
default_authentication_plugin= mysql_native_password
Then run following command:
FLUSH PRIVILEGES;
Above command will bring into effect the changes of default authentication mechanism.
I've tried a lot of other solutions, but only this works for me.
Thanks for the workaround.
Check your .env
MYSQL_VERSION=latest
Then type this command
$ docker-compose exec mysql bash
$ mysql -u root -p
(login as root)
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
ALTER USER 'root'#'%' IDENTIFIED WITH mysql_native_password BY 'root';
ALTER USER 'default'#'%' IDENTIFIED WITH mysql_native_password BY 'secret';
Then go to phpmyadmin and login as :
host -> mysql
user -> root
password -> root
None of the answers here worked for me. What I had to do is:
Re-run the installer.
Select the quick action 're-configure' next to product 'MySQL Server'
Go through the options till you reach Authentication Method and select 'Use Legacy Authentication Method'
After that it works fine.
Faced the same problem, I was not able to run wordpress docker container with mysql version 8 as its default authentication mechanism is caching_sha2_password instead of mysql_native_password.
In order to fix this problem we must reset default authentication mechanism to mysql_native_password.
Find my.cnf file in your mysql installation, usually on a linux machine it is at the following location - /etc/mysql
Edit my.cnf file and add following line just under heading [mysqld]
default_authentication_plugin= mysql_native_password
Save the file then log into mysql command line using root user
run command FLUSH PRIVILEGES;
I'm using Laravel Lumen to build a small application.
For me it was because I didn't had the DB_USERNAME defined in my .env file.
DB_USERNAME=root
Setting this solved my problem.
In my.cnf file check below 2 steps.
check this value -
old_passwords=0;
it should be 0.
check this also-
[mysqld] default_authentication_plugin= mysql_native_password Another
value to check is to make sure
[mysqld] section should be like this.
preferences -> mysql -> initialize database -> use legacy password encryption(instead of strong) -> entered same password
as my config.inc.php file, restarted the apache server and it worked. I was still suspicious about it so I stopped the apache and mysql server and started them again and now it's working.
This question already has answers here:
php mysqli_connect: authentication method unknown to the client [caching_sha2_password]
(17 answers)
Closed 3 years ago.
I'm running MySQL version 8 on PHP 7.0.
I'm getting the following error when I try to connect to my database from PHP:
Connect Error: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
PHP might show this error
Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password] in D:\xampp\htdocs\reg\server.php on line 10
How can I fix this problem?
#mohammed, this is usually attributed to the authentication plugin that your mysql database is using.
By default and for some reason, mysql 8 default plugin is auth_socket. Applications will most times expect to log in to your database using a password.
If you have not yet already changed your mysql default authentication plugin, you can do so by:
1. Log in as root to mysql
2. Run this sql command:
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password
BY 'password';
Replace 'password' with your root password. In case your application does not log in to your database with the root user, replace the 'root' user in the above command with the user that your application uses.
Digital ocean expounds some more on this here Installing Mysql
You have to change MySQL settings.
Edit my.cnf file and put this setting in mysqld section:
[mysqld]
default_authentication_plugin= mysql_native_password
Then run following command:
FLUSH PRIVILEGES;
Above command will bring into effect the changes of default authentication mechanism.
I've tried a lot of other solutions, but only this works for me.
Thanks for the workaround.
Check your .env
MYSQL_VERSION=latest
Then type this command
$ docker-compose exec mysql bash
$ mysql -u root -p
(login as root)
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
ALTER USER 'root'#'%' IDENTIFIED WITH mysql_native_password BY 'root';
ALTER USER 'default'#'%' IDENTIFIED WITH mysql_native_password BY 'secret';
Then go to phpmyadmin and login as :
host -> mysql
user -> root
password -> root
None of the answers here worked for me. What I had to do is:
Re-run the installer.
Select the quick action 're-configure' next to product 'MySQL Server'
Go through the options till you reach Authentication Method and select 'Use Legacy Authentication Method'
After that it works fine.
Faced the same problem, I was not able to run wordpress docker container with mysql version 8 as its default authentication mechanism is caching_sha2_password instead of mysql_native_password.
In order to fix this problem we must reset default authentication mechanism to mysql_native_password.
Find my.cnf file in your mysql installation, usually on a linux machine it is at the following location - /etc/mysql
Edit my.cnf file and add following line just under heading [mysqld]
default_authentication_plugin= mysql_native_password
Save the file then log into mysql command line using root user
run command FLUSH PRIVILEGES;
I'm using Laravel Lumen to build a small application.
For me it was because I didn't had the DB_USERNAME defined in my .env file.
DB_USERNAME=root
Setting this solved my problem.
In my.cnf file check below 2 steps.
check this value -
old_passwords=0;
it should be 0.
check this also-
[mysqld] default_authentication_plugin= mysql_native_password Another
value to check is to make sure
[mysqld] section should be like this.
preferences -> mysql -> initialize database -> use legacy password encryption(instead of strong) -> entered same password
as my config.inc.php file, restarted the apache server and it worked. I was still suspicious about it so I stopped the apache and mysql server and started them again and now it's working.
I am teaching myself how to code by watching Kevin Skoglund movies on Lynda. I am having troubles on one of the chapters in the series - creating a database. I am trying to log on to MySQL but is showing like this-
Rosss-MacBook-Air:~ rossnyland$ mysql -user -p
Enter password:
ERROR 1045 (28000): Access denied for user 'ser'#'localhost' (using password: YES)
Rosss-MacBook-Air:~ rossnyland$
The password is right because when I type a wrong password it will say (using password: NO)
What am I doing wrong? MySQL server is running, I'm using 5.7.20 version, using MAC OS x, and have tried to log on on mysqlworkbench, but message pops up saying this
Your connection attempt failed for user 'root' from your host to server at localhost:3306:
Access denied for user 'root'#'localhost' (using password: YES)
Please:
1 Check that mysql is running on server localhost
2 Check that mysql is running on port 3306 (note: 3306 is the default, but this can be changed)
3 Check the root has rights to connect to localhost from your address (mysql rights define what clients can connect to the server and from which machines)
4 Make sure you are both providing a password if needed and using the correct password for localhost connecting from the host address you're connecting from
Even I tried to delete it but no success! Please tell me what am I doing wrong or how to start over again...
The password could be right, but I doubt your user is ser.
When you use the command-line option -u, any text you put after it, is the username.
So if your username for mysql is mysql_user, you need:
$ mysql -umysql_user -p
or:
$ mysql -u mysql_user -p
or:
$ mysql --user=mysql_user --password
For the Command Line Tool error, you probably provided the wrong command. It should be:
$ mysql -u username -p
For the MySQL Workbench error, there are two possibilities:
You provided the wrong password for 'root'#'localhost'. Or the user 'root'#'localhost' didn't exist.
Your MySQL server didn't listen on the localhost interface. In other words, check the value of bind_ip in your my.cnf config file. You should provide the actual ip address by --host option in this case.
You can also check this answer I posted before, it shows you the full steps to solve this kind of problems.
I know the title looks familiar but no. I was working on a web app, and when I ran it, it says: Access denied for user 'root'#'localhost' (using password: NO). I searched some sites and they said that I should use a password. So I changed the password using mysql console. Than I got this message Access denied for user 'root'#'localhost' (using password: YES). And when I reenter the mysql console and put the password it makes a beep than it is closed. I got this event log:
Log Name: Application
Source: .NET Runtime
Date: 10/18/2015 7:12:51 PM
Event ID: 1026 Task Category: None Level: Error Keywords:
Classic User: N/A Computer: TOSHIBA-TOSH Description:
Application: MySQLWorkbench.exe Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.Remoting.RemotingException Stack: at
System.Runtime.Remoting.Channels.Ipc.IpcServerChannel.StartListening(System.Object)
at
MySQL.Workbench.ApplicationInstanceManager.RegisterRemoteType(System.String)
at
MySQL.Workbench.ApplicationInstanceManager.CreateSingleInstance(System.String,
System.String[],
System.EventHandler`1)
at MySQL.GUI.Workbench.Program.Main(System.String[])
Event Xml:
1026
2
0
0x80000000000000
537897
Application
TOSHIBA-TOSH
Application: MySQLWorkbench.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled
exception. Exception Info: System.Runtime.Remoting.RemotingException
Stack: at
System.Runtime.Remoting.Channels.Ipc.IpcServerChannel.StartListening(System.Object)
at
MySQL.Workbench.ApplicationInstanceManager.RegisterRemoteType(System.String)
at
MySQL.Workbench.ApplicationInstanceManager.CreateSingleInstance(System.String,
System.String[],
System.EventHandler`1<MySQL.Workbench.InstanceCallbackEventArgs>)
at MySQL.GUI.Workbench.Program.Main(System.String[])
Any help ? I uninstalled everything (wamp, mysql, dreamweaver,.........) but still got the same problem. And mysql workbench give this error when i enter the password .
I tried to use config.inc.php solutions but still the same.
Please follow below steps:
Go to mysql server console and follow below steps:
Step1: open your config file and add below lines in [mysqld] section and save file.
skip-grant-tables
skip-networking
Step2: Restart your mysql service, you can use below command if using linux.
service mysqld restart
Step3: Now connect mysql by below command-
mysql -uroot
Step4: Above command will connect you with mysql and will show mysql prompt like below-
mysql>
Step5: Now change root password as per below-
mysql> update mysql.user set password = password('root123') where user='root';
OR
mysql> update mysql.user set password = password('root123') where user='root' and host = 'localhost';
mysql> flush privileges;
mysql> exit;
Step6: Now remove newly added lines from config file and restart mysql service again as per step2.
Finally now you can connect your web or phpmyadmin with root user.
Maybe root from localhost has not the required grant to access the DB.
Try to run the following on a mysql console:
GRANT ALL ON <yourdb>.* TO 'root'#'localhost';
FLUSH PRIVILEGES;
This seems like it should be pretty easy but I am running into problems trying to create a database following these instructions: http://symfony.com/doc/master/book/doctrine.html
I edit the parameters.yml and config.yml file and then run this command from terminal:
php app/console doctrine:database:create
The error I am getting is:
Could not create database for connection named `learn_symfony`
SQLSTATE[28000] [1045] Access denied for user 'root'#'localhost' (using password: YES)
How do I resolve this error and create the database?
The problem is that you are probably trying to connect on a server that isn't configured properly.
There is nothing to do with doctrine.
Tell me, are you trying to connect to a home-made server ? Is it a LAMP or WAMP stack ?
EDIT
If you are running on a recently installed server, you have to edit the MySQL configuration and set a password to the root account or set on the directive allowNullPassword
EDIT 2
If your server is LAMP, the file you have to change is located at /etc/my.cnf
EDIT 3
That file is for various mysql configurations.
About the allow null i was mistaking with phpMyAdmin.
Try setting a password for the root with this command
mysqladmin -u root password MYVERYNEWANDSECRETPASSWORD