1.linux安装mysql
//我所使用linux系统为centOS,如果使用的是redhat,由于yum源收费所以会导致无法使用yum指令,需要自己手动换源。
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-server
2.修改密码
systemctl restart mysqld
mysql -uroot
use mysql;
update user set password=password("******") where user=‘root’;
flush privileges;
exit;
3.设置其他ip可以访问该mysql库
mysql -uroot -p’*****’
use mysql;
//查看可访问mysql库可访问ip
select host from user where user=‘root’;
//修改其中一条为’%’,即任何ip都可访问
update user set host = ‘%’ where user =‘root’ and host =***;
flush privileges;