MYSQL SETUP

From ElectroDragon Wiki
Revision as of 00:31, 8 May 2020 by Chao (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

For remote access MYSQL8

  • CREATE USER 'root'@'%' IDENTIFIED BY '123';
  • GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
  • flush privileges;

Set remote login for Adminer

  • ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

For remote access MYSQL5

  • nano /etc/mysql/my.cnf
  • comment bind-address = 127.0.0.1
  • Check netstat -an|grep 3306

GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'IP' IDENTIFIED BY 'PASSWORD' with grant option;

  • . for all databases
  • USERNAME can change to root
  • IP can use %, or specific IP address
  • PASSWORD need to be changed
  • example
Header text Header text Header text
Example Example Example
Example GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'new-password' with grant option; Example
Example GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; Example

flush privileges;