Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql setup script does not use login file #73

Open
AkshayBarad opened this issue Aug 28, 2018 · 2 comments
Open

mysql setup script does not use login file #73

AkshayBarad opened this issue Aug 28, 2018 · 2 comments
Labels

Comments

@AkshayBarad
Copy link

Hello,

  • OS type and version MacOS 10.13.6
  • DB: mysql v8.0.12
  • DB Installation type: brew
  • Node version v10.6.0

When running the setup script mysql.sh via npm run db:setup:mysql, the mysql and mysqladmin commands do not make use of the login config file created in the setup process. We saw the following output:

- Removing any existing northwind database (you may need to provide a password)
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'akshay'@'localhost' (using password: NO)'
 - Removing any existing northwind_user user
ERROR 1045 (28000): Access denied for user 'akshay'@'localhost' (using password: NO)
 - Creating northwind_user
ERROR 1045 (28000): Access denied for user 'akshay'@'localhost' (using password: NO)
 - Creating northwind database
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'akshay'@'localhost' (using password: NO)'
 - Granting all northwind database permissions to northwind_user
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
 - Setting up schema from ./sql/northwind.mysql.sql
ERROR 1045 (28000): Access denied for user 'akshay'@'localhost' (using password: NO)
 - Importing data from ./sql/northwind_data.sql (this may take a while)
ERROR 1045 (28000): Access denied for user 'akshay'@'localhost' (using password: NO)

We resolved the issue by adding aliases in the mysql.sh file like so:

alias mysqladmin='mysqladmin --login-path=local'
alias mysql='mysql --login-path=local'

I am unsure if this is relevant to all operating systems and all versions of mysql.

I intend to make a PR but would like to wait until I finish the course so that I can ensure that my PR includes fixes to all instances of this specific issue.

Akshay Barad
BitCraft

@mike-north
Copy link
Member

This is a permissions issue on your local machine. The easiest way to take the course on a Mac is using https://postgresapp.com

@AkshayBarad
Copy link
Author

Thank you @mike-north, will switch to postgres if there's further trouble. We wanted to familiarise ourselves specifically with mysql because that's what we plan on using for an upcoming project.

Would you be open to accepting the PR I mentioned? My colleague who is following the course from Ubuntu 18.04 with mysql v5.x also faced the issue and setting the aliases helped him as well. I don't see any negative side effects of setting the aliases in conditions when everything works out of the box.

PS: Our entire team has greatly enjoyed and benefited from your courses on FEM. Thank you for being awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants