Skip to content

Instantly share code, notes, and snippets.

@jhonoryza
Last active June 12, 2023 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhonoryza/61bbe6c84173440b501a24431a8ffb9a to your computer and use it in GitHub Desktop.
Save jhonoryza/61bbe6c84173440b501a24431a8ffb9a to your computer and use it in GitHub Desktop.
setup mysql 8

setup mysql

sudo mysql_secure_installation

enable remote access

  • edit /etc/mysql/mysql.conf.d/mysqld.cnf
  • set bind-address
bind-address            = 0.0.0.0

create new user

create user 'ubuntu';
grant all privileges on *.* to 'ubuntu' with grant option;
flush privileges;
alter user ubuntu identified with mysql_native_password by 'secret';

check open port

set root pass

ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'yourpasswd';
@jhonoryza
Copy link
Author

CREATE USER 'root'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON . TO 'root'@'%' WITH GRANT OPTION;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment