电子说
1、下载rpm包:wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
2、执行rpm包:rpm -Uvh mysql57-community-release-el7-11.noarch.rpm
3、安装mysql:yum install mysql-community-server
4、启动mysql:service mysqld start(systemctl start mysqld.service)
5、设置开机启动:systemctl enable mysqld.service
6、查看启动状态:systemctl status mysqld.service
7、查看密码:grep ‘temporary password’ /var/log/mysqld.log7、跳过密码复杂程度,进入/etc/my.cnf文件在末尾添加:validate_password = off,(设置mysql不区分大小写在[mysqld]之后添加:lower_case_table_names=1)重启mysql服务
8、修改密码:set password =password(‘root’);
9、开启远程访问:grant all privileges on *.* to ‘root’ @‘%’ identified by ‘root’;
10、刷新权限:flush privileges;
11、查看mysql数据库编码: show variables like ‘character%’;
12、设置编码格式为utf8:在/etc/my.cnf文件中的[mysqld]之前添加[client] default-character-set=utf8,在[mysqld]之后添加 character-set-server=utf8
13、重启mysql:systemctl restart mysqld.service/**********防火墙**********/1、查看开放端口:firewall-cmd --list-ports2、开启端口号:firewall-cmd --zone=public --add-port=80/tcp --perman
全部0条评论
快来发表一下你的评论吧 !