安装配置mysql

Posted by walikrence on August 12, 2019

安装配置mysql

环境

Ubuntu 18.04

安装

sudo apt install mysql-server -y

初始化配置

sudo mysql_secure_installation

修改配置

vim /etc/mysql/mysql.conf.d/mysqld.cnf

原为

bind-address            = 127.0.0.1

修改为

bind-address            = 0.0.0.0

新建用户

grant ALL PRIVILEGES on *.*  to asd@'%' identified by '123';
\q

重启mysql

/etc/init.d/mysql restart

远程登陆mysql

 mysql -h 123.123.123.123 -P 3306 -u asd -p123