Skip to content

Instantly share code, notes, and snippets.

@diki-haryadi
Last active September 23, 2021 03:48
Show Gist options
  • Select an option

  • Save diki-haryadi/72707f6b0030fb2a2368a1b902e33986 to your computer and use it in GitHub Desktop.

Select an option

Save diki-haryadi/72707f6b0030fb2a2368a1b902e33986 to your computer and use it in GitHub Desktop.
Install and Config Mysql on Ubuntu

$ sudo apt install default-mysql-server default-mysql-client

$ sudo cat /etc/mysql/debian.cnf

# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = JRptVM1k9l8SvIau
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint
password = JRptVM1k9l8SvIau
socket   = /var/run/mysqld/mysqld.sock

$ mysql -u debian-sys-maint -p mysql> SELECT User, Host, plugin FROM mysql.user;

mysql> UPDATE mysql.user SET plugin = 'mysql_native_password'; mysql> FLUSH PRIVILEGES;

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'P@ssw0rd'; mysql> FLUSH PRIVILEGES;

config

  1. Delete the problematic user DROP USER 'mysql.infoschema'@'localhost';

The rest of the solution is like previous answers.

  1. Create the user again mysql> CREATE USER 'mysql.infoschema'@'localhost' IDENTIFIED BY 'password';

  2. Grant it permissions mysql> GRANT SELECT ON . TO mysql.infoschema@localhost;

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