安装mysql
sudo apt-get install mysql-server mysql-common mysql-client
登录
mysqladmin -u root password your-new-password
重启
sudo /etc/init.d/mysql restart
设置MySQL远程访问:
(不同版本的Linux版本,安装的MySQL目录可能不太一样,有以下两种目录,可以先查询/etc/mysql目录,再根据目录和文件名进行执行以下对应的脚本)
①sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
②sudo vim /etc/mysql/my.cnf
注释掉:
bind-address = 127.0.0.1
MySQL开启root远程访问权限
grant all privileges on *.* to root@'%' identified by "xxxx@0905" with grant option;
flush privileges;
网友评论