Closed toyflish closed 2 years ago
I've just installed Nitro and I'm getting this too.
Can you run nitro ls
and verify the database container is running?
@shornuk are you also using mysql v8?
I can vouch for @shornuk, yes he is. Fresh install of Docker, Nitro and MySQL 8, PHP 7.4. Valet still present (not sure if that makes any difference). Docker all green and running in the dashboard. Port was originally blocked by Valet on install, but valet service stopped and nitro init completed.
reinstalled with mysql 5.7 , same behaviour as described above. looks like all run
nitro ls
Hostname Type Status
mysql-5.7-3306.database.nitro database running
nitro-proxy proxy running
oneworld.nitro site running
when I try adding a database it fails, if I try to send the same command with my mysql-cli it fails as well because the user nitro in the mysql-server not has the right privileges
nitro db add
Enter the new database name: oneworld
… creating database oneworld Error: rpc error: code = Internal desc = error creating database: Exit Status: 1
Commands: --user=nitro --host=mysql-5.7-3306.database.nitro -pnitro -e CREATE DATABASE IF NOT EXISTS oneworld;
mysql --user=nitro --host=mysql-5.7-3306.database.nitro -pnitro -e "CREATE DATABASE IF NOT EXISTS oneworld;"
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1044 (42000) at line 1: Access denied for user 'nitro'@'%' to database 'oneworld'
if I log in as root to the mysql container and grant privileges to nitro it works mysql> GRANT ALL PRIVILEGES ON . TO 'nitro'@'%';
nitro db add
Enter the new database name: oneworld
… creating database oneworld ✓
Database "oneworld" added to "mysql-5.7-3306.database.nitro" successfully 💪
Since I‘m not into go I just can give hints. So I think this command is not executed by setting up the database container:
{"mysql", "-uroot", "-pnitro", fmt.Sprintf(`-e GRANT ALL PRIVILEGES ON *.* TO '%s'@'%s' WITH GRANT OPTION;`, "nitro", "%")},
Hi, we are closing this issue as we have decided to retire Nitro, so no additional work will occur on this project. You can read the official blog post here https://craftcms.com/blog/retiring-craft-nitro. We appreciate everyones feedback and involvement and we look forward to refocusing our efforts on Cloud!
If you're looking for a new local development environment, we recommend DDEV and have a knowledge base article to help you with the transition: https://craftcms.com/knowledge-base/migrating-from-craft-nitro-to-ddev.
Description
I brew installed nitro, ran nitro init for setting up nitro, ran nitro add from inside craft project directory, typed in database name, database creation was confirmed 💪. Could not import database exit with error, logged into mysql container with mysql-cli, only informaition_schema and nitro db present. But my "oneworld" db was missing.
adding the site with database named "oneworld"
trying to import
connecting to mysql container listing the databases
trying to create database
Steps to reproduce
Additional info
I nitro destroyed and tried with mysql-5.7 , same problem , no database created