Centos源码安装mysql5.7

下载安装包:

shell> wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

安装:

shell>yum localinstall mysql57-community-release-el7-11.noarch.rpm

查看是否安装成功:

 

安装mysql-server:

shell> yum install mysql-community-server

 

启动mysql:

shell>systemctl start mysqld

 

查看mysql状态:

shell>systemctl status mysqld

 

获取mysql默认密码:

shell>grep 'temporary password' /var/log/mysqld.log

 

修改mysql密码:

mysql>alter user 'root'@'localhost' identified by '密码';(包含大小写英文字母、数字以及符号)

 

设置远程登录:

mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;

 

修改mysql 默认编码:

shell>vi /etc/my.cnf 

[mysqld]下增加character_set_server=utf8与init_connect='SET NAMES utf8'

 

重启mysql:

mysql>systemctl restart mysqld

 

查看编码:

mysql>show variables like '%character%';

 

posted @ 2017-06-14 17:31  Free-program  阅读(134)  评论(0)    收藏  举报