아래와 같이 설정 사용 합니다.
ssh#> etc/init.d/mysqld start
ssh#> mysql
mysql#> use mysql;
mysql#> update user set password=password('root패스워드') where user='root';
mysql#> flush privileges;
mysql#> exit;
# 5.7 이상
> update user set authentication_string=password('new password') where user = 'root';
# 8.x 이상
> alter user 'root'@'localhost' identified with mysql_native_password by 'new password';
# 5.6 이하
> update user set password=password('new password') where user = 'root';
create user 'testting'@'localhost' identified by 'password'
grant all privileges on *.* to 'testting'@'localhost';
create database DB이름
grant all privileges on DB이름.* to 'testting'@'localhost';
mysql - 새로운 사용자 추가
mysql#> use mysql;
mysql#> create database 데이터베이스명 ;
mysql#> grant all privileges on 데이터베이스명.* to 추가하고싶은계정아이디@localhost identified by '추가하는계정의패스워드' with grant option;
mysql#> flush privileges ;