Closed sabelapaulo closed 3 years ago
Hi there! Regarding the mysql error, you may find this answer useful.
As for your attempt to use sqlite, did you run the new
command again after creating that config file? You mentioned creating a ~/.wp-cli/config
but it should be ~/.wp-cli/config.yml
. You can check the loaded config files by running wp --info
.
The updates to the config file are not really necessary unless you want to change the defaults. If you just want to create a new site using sqlite, you can run wp valet new site --portable
and you should be good to go.
Let me know how it goes 😄
Thanks much for the response, and how embarrassing I forgot the .yml in config.yml! I tried updating the ~/.wp-cli/config.yml
and then testing the commands again and unfortunately it still didn't work for me. I get the same error messages. I can't be certain that it is attempting to use sqlite vs mysql though. The packages I've installed are libsqlite3
and sqlite3
.
I tried wp valet new site
and wp valet new site --portable
, but neither seem to work. I get the same mysql error without the --portable
and with --portable
I get this error message:
% wp valet new site --portable
Don't go anywhere, this should only take a second...
Error: ERROR 1698 (28000): Access denied for user 'root'@'localhost'
I did then try to implement SO answer you mentioned (option #2). I can now mysql -v without any error unlike before, but still get the same error doing wp valet new site
or wp valet new site --portable
.
Hmm, that's definitely a mysql error when it shouldn't be trying to use mysql.
Can you please show me the specific version of the command you're running? You can see it with this command:
composer show aaemnnosttv/wp-cli-valet-command -d ~/.wp-cli/packages
You can share the whole thing there, but the values of source
and dist
are the relevant parts of it.
^^
Im getting this same error... on Ubuntu 20.04 , Trying with a bedrock project, new mariadb installed via apt.
these are from composer show
source : [git] https://github.com/aaemnnosttv/wp-cli-valet-command.git 739ed285192d04086d2453c00ed7d9260fd609fa
dist : [zip] https://api.github.com/repos/aaemnnosttv/wp-cli-valet-command/zipball/739ed285192d04086d2453c00ed7d9260fd609fa 739ed285192d04086d2453c00ed7d9260fd609fa
After testing this on Ubuntu 20 I found that there are a few extra steps needed after installing mysql-server
to allow running commands as the mysql root
user.
First, login to mysql as the root user (requires sudo
at first which is why this is failing)
$ sudo mysql -u root
Then from mysql prompt (Source):
mysql> UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE user = 'root' AND plugin IN ('unix_socket', 'auth_socket');
mysql> FLUSH PRIVILEGES;
mysql> exit
Finally, restart the mysql service
$ sudo service mysql restart
The valet command then works as expected 👍
vagrant@ubuntu-focal:~/sites$ wp valet new site --unsecure
Don't go anywhere, this should only take a second...
Success: site ready! http://site.test
wp valet new site --dbpass=local_root_password
doesn't seem to work for me on Ubuntu 20.04.I get the output:
mysql is installed, but
mysql -v
gives me:I then also installed sqlite3, and created a ~/.wp-cli/config with the following:
But it doesn't seem to be using sqlite? I'm not sure. I don't care which database is used, just whichever one is the simplest to configure. Any advice?