I am working in Symfony application on my Mac and I continue getting this message: An exception occured in driver: SQLSTATEHY000 1045 Access denied for user 'root'@'localhost' (using password: NO) I have tried it without password, with password, I have tried it in this mysql -u root, in this manner mysql -u root -p. I have tried shutting down the server and I get this answer: ldco2016@DCortes-MacBook-Pro-3 /Projects/eventcalendar (master●)$ /usr/local/mysql/support-files/mysql.server stop ruby-2.2.5 ERROR! MySQL server PID file could not be found! Somebody help:(.
In simple words your 'root' session do not know password to mysql root user. If you want to make easier to access your mysql create.my.cnf in /root/ and put in it mysqladmin user = root password = mysqlrootpassword mysql user = root password = mysqlrootpassword mysqldump user = root password = mysqlrootpassword where offcourse mysqlrootpassword is your password for mysql's root password so when you execute mysql it uses this password Remeber about safety of this file - put secure rights, so nobody on your server can read it!
![Mysql access denied for user Mysql access denied for user](http://www.ashreinu.us/wp-content/uploads/2017/05/access-denied-for-user-rootlocalhost-using-password-no.jpg)
![Access denied for user Access denied for user](/uploads/1/2/5/3/125355229/422454193.png)
Problems solved use that username and password in your program if you encounter any more errors so comment down i will post a video on that. Thanks for Watching.like share and Subscribe.