Open edwardjosephbennett opened 5 years ago
Hey there 👋
Currently the valet new
command does not offer an option to provide the db charset or collation.
What you can do however, is add (temporarily?) these as defaults in your wp-cli config file like so:
core config:
dbcharset: yourcharset
dbcollate: yourcollation
Let me know if this does it for you!
Trying to use core config
for the charset but I need to mix it with config create
- can I use both in the same file?, as now where I position it makes the other not be set
admin_user: admin
admin_password: "password"
admin_email: me@you.com
locale: en_AU
# Subcommand defaults (e.g. `wp config create`)
config create:
dbuser: root
dbpass:
extra-php: |
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
@ini_set( 'display_errors', 0 );
define( 'WP_POST_REVISIONS', 7 );
core config:
dbcharset: utf8mb4
Actually works if I include it in config create
admin_password: "password"
admin_email: me@you.com
locale: en_AU
# Subcommand defaults (e.g. `wp config create`)
config create:
dbuser: root
dbpass:
dbcharset: utf8mb4
extra-php: |
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
@ini_set( 'display_errors', 0 );
define( 'WP_POST_REVISIONS', 7 );
Hi,
Is it possible to set the Database Collation and Database Charset when running wp valet new site?
I have been tinkering around with this and valet and find the setup fantastically useful, although this issue has been bugging me for a while.
At the minute when running the new site command, a database gets created with the following collation:
I have a plugin that creates database tables, which throws up errors on activation regarding and incorrect collation type. See an example of stack trace below:
The issue I think sits around the either the plugin trying to
set names 'utf8...'
or the original collation being set with the 520 part is wrong.Current MySQL Version is: Ver 8.0.13 for osx10.14 on x86_64 (Homebrew)
Any help on how this issue may be worked around either from WP-CLI Valets point of view or WP-CLI itself is appreciated.
Thanks, Ed