Error while running bench new-site site1.local

I installed all the dependencies and now I’m just following steps from GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps

I’m getting below error -
For key character_set_server. Expected value utf8mb4, found value latin1
For key collation_server. Expected value utf8mb4_unicode_ci, found value latin1_swedish_ci

================================================================================

Creation of your site - site1.local failed because MariaDB is not properly
configured. If using version 10.2.x or earlier, make sure you use the
the Barracuda storage engine.

Please verify the settings above in MariaDB’s my.cnf. Restart MariaDB. And
then run bench new-site site1.local again.

Has someone faced this issue before? Can someone please help?

It has still created site1.local directory though

These steps from Hitchhiker’s guide should help:

Next you’ll need the MySQL database development files

$ sudo apt-get install libmysqlclient-dev

You also need to edit the mariadb configuration (although the guide in README doesn’t mention this, you’ll face an error message asking you to do exactly this if you follow the README. So you might as well go ahead and do this)

$ sudo nano /etc/mysql/my.cnf

And add this to the file

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4

(Now press (Ctrl-X) to exit!) Finally restart the mysql server and you’ll be good to go!

$ sudo service mysql restart

5 Likes

It got resolved, but i did not have to run sudo apt-get install libmysqlclient-dev

Also I edited /etc/mysql/mariadb.cnf instead of my.cnf… it former imports the later

But your solution could have worked as well probably

1 Like

@Xerxys_300 / @root13F:

I’m following along the Hitchhiker’s Installation Guide and getting the same error after updating /etc/mysql/my.cnf and then restarting mariadb

configuration 
    Ubuntu 18.04.4 LTS | mariadb 10.3 | 

/etc/mysql/my.cnf

[mysqld]
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc_messages_dir = /usr/share/mysql
lc_messages     = en_US
skip-external-locking
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci    <--------------
For key collation_server. Expected value utf8mb4_unicode_ci, found value utf8mb4_general_ci
================================================================================
Creation of your site - BTEST18 failed because MariaDB is not properly
configured.  If using version 10.2.x or earlier, make sure you use the
the Barracuda storage engine.

Please verify the settings above in MariaDB's my.cnf.  Restart MariaDB.  And
then run `bench new-site BTEST18` again.


================================================================================
Database settings do not match expected values; stopping database setup.

Brandon

It’s possible you are looking at the wrong mysql,config path.

The following might help.

mysql --help | grep my.cnf

@crafter:

It’s very possible. I will checkout in the morning. Thanks.

all:

found the issue and was able to resolve.

issue:

  • /etc/mysql/my.cnf includes /etc/mysql/mariadb.cnf
  • /etc/mysql/mariadb.cnf includes /etc/mysql/mariadb.conf.d/
  • /etc/mysql/mariadb.conf.d/ includes 50-server.cnf
file: /etc/mysql/maridb.conf.d/50-server.cnf

[original] collation-server = utf8mb4_general_ci
[new] collation-server = utf8mb4_unicode_ci

thanks @crafter

btest

6 Likes

refer,

Hi Root13F,
I am facing this same issue, Can you help me please (ranaonlinestores@gmailcom)
I am installing ERPnext on Azure.

Thank you! You have saved my life!

Great Thanks

Found this helpful:

1 Like

Hi
What did you do to resolve I am facing same issue.

Working for me, Thanks Man

you are god. Have been struggling with mariadb since a week.