MySQL add user privilege

Linux config mysql

go to /etc/mysql/mysql.conf.d/

> vim mysqld.conf

command out

bind-address =


# bind-address =


get in mysql

$ mysql -u root -p  (-localhost)
Enter password:

if you want to create user fun with password love, and who can access the database from anywhere

> create user 'fun'@'%' identified by 'love'


> grant all privileges on *.* to 'fun'@'%' with grant option;

>flush privileges;


mysql> GRANT ALL ON . to root@’′ IDENTIFIED BY ‘your-root-password’;