0

I am installing Erpnext in my ubuntu 18.04 Lts. I want to know how to set password for MySql root user.

I am installing erpnext in my ubuntu 18.04 LTS. while running the command - 'sudo bench new-site site4.local' for creating a new frappe site, it is asking for - 'MySQL root password':

I have tried - sudo mysql --user=root mysql' but it is giving output as- mysql: unknown variable 'pid-file=/var/run/mysqld/mysqld.pid

pymysql.err.InternalError: (1698, "Access denied for user 'root'@'localhost'")
mik1904
  • 1,335
  • 9
  • 18
Nitish awasthi
  • 133
  • 2
  • 10

1 Answers1

0

You need to set root password if not set already. While setting root password check if password plugin is set to mysql_native_password or not. If password plugin is set to unix_socket change it to mysql_native_password. unix_socket ignore passwords and allow the corresponding Unix user in without a password check. To change plugin type follow below command:

sudo mysql -u root -p
UPDATE mysql.user SET plugin = 'mysql_native_password', 
      Password = PASSWORD('NEWPASSWORD') WHERE User = 'root';
flush privileges;
quit;

Replace NEWPASSWORD with your password