As am trying to create a new site a traceback call arise

$ bench new-site lib
MySQL root password:
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/innolearn/redis-3.2.5/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/innolearn/redis-3.2.5/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/innolearn/redis-3.2.5/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/innolearn/redis-3.2.5/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/innolearn/redis-3.2.5/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/innolearn/redis-3.2.5/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/innolearn/redis-3.2.5/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/innolearn/redis-3.2.5/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/innolearn/redis-3.2.5/frappe-bench/apps/frappe/frappe/commands/site.py”, line 26, in new_site
verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
File “/home/innolearn/redis-3.2.5/frappe-bench/apps/frappe/frappe/commands/site.py”, line 56, in _new_site
admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
File “/home/innolearn/redis-3.2.5/frappe-bench/apps/frappe/frappe/installer.py”, line 34, in install_db
create_database_and_user(force, verbose)
File “/home/innolearn/redis-3.2.5/frappe-bench/apps/frappe/frappe/installer.py”, line 52, in create_database_and_user
if force or (db_name not in dbman.get_database_list()):
File “/home/innolearn/redis-3.2.5/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 540, in get_database_list
return [d[0] for d in self.db.sql(“SHOW DATABASES”)]
File “/home/innolearn/redis-3.2.5/frappe-bench/apps/frappe/frappe/database.py”, line 106, in sql
self.connect()
File “/home/innolearn/redis-3.2.5/frappe-bench/apps/frappe/frappe/database.py”, line 52, in connect
use_unicode=True, charset=‘utf8’)
File “/home/innolearn/redis-3.2.5/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py”, line 81, in Connect
return Connection(*args, **kwargs)
File “/home/innolearn/redis-3.2.5/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 193, in init
super(Connection, self).init(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, “Access denied for user ‘root’@‘localhost’ (using password: YES)”)

1 Like

Hi @Pranjal_Dubey,

You have entered wrong password for mysql root, kindly confirm it before enter.

Hi @Pranjal_Dubey and if the problem persists , try the steps mentioned in the below link

I am still unable to get rid of this, I tried blank string, root, your_password but none are giving the correct result.

Followed every comment still the same:
bench new-site site1.local
MySQL root password:
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/innolearn/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/innolearn/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/innolearn/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 716, in call
return self.main(*args, **kwargs)
File “/home/innolearn/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 696, in main
rv = self.invoke(ctx)
File “/home/innolearn/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/innolearn/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/innolearn/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/innolearn/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 534, in invoke
return callback(*args, **kwargs)
File “/home/innolearn/frappe-bench/apps/frappe/frappe/commands/site.py”, line 26, in new_site
_new_site(db_name, site, mariadb_root_username=mariadb_root_username, mariadb_root_password=mariadb_root_password, admin_password=admin_password, verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
File “/home/innolearn/frappe-bench/apps/frappe/frappe/commands/site.py”, line 44, in _new_site
install_db(root_login=mariadb_root_username, root_password=mariadb_root_password, db_name=db_name, admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
File “/home/innolearn/frappe-bench/apps/frappe/frappe/installer.py”, line 33, in install_db
create_database_and_user(force, verbose)
File “/home/innolearn/frappe-bench/apps/frappe/frappe/installer.py”, line 53, in create_database_and_user
if force or (db_name not in dbman.get_database_list()):
File “/home/innolearn/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 526, in get_database_list
return [d[0] for d in self.db.sql(“SHOW DATABASES”)]
File “/home/innolearn/frappe-bench/apps/frappe/frappe/database.py”, line 106, in sql
self.connect()
File “/home/innolearn/frappe-bench/apps/frappe/frappe/database.py”, line 52, in connect
use_unicode=True, charset=‘utf8’)
File “/home/innolearn/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py”, line 81, in Connect
return Connection(*args, **kwargs)
File “/home/innolearn/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 193, in init
super(Connection, self).init(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1045, “Access denied for user ‘root’@‘localhost’ (using password: YES)”)

Terminal is not even accepting grant option to change the password settings
GRANT ALL ON . TO ‘root’@‘%’ WITH GRANT OPTION;
GRANT: command not found

cd /usr/local/mysql/bin
bash: cd: /usr/local/mysql/bin: No such file or directory

Hi @Pranjal_Dubey

Are you able to login into mysql , mysql -u root -p

1 Like

This I got

mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)

sudo /usr/bin/mysql_secure_installation
[sudo] password for innolearn:

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we’ll need the current
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
Enter current password for root (enter for none):

Hi @Pranjal_Dubey,

As per message, the entered password for mysql root is incorrect

@Pranjal_Dubey
Reset MySQL Password then try to create new site. use below link.
https://help.ubuntu.com/community/MysqlPasswordReset

On the 1st step I got -
mysql -u root
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)