-
MySQL 下载地址:http://dev.mysql.com/downloads/mysql/
选择版本:centos6 对应红帽的linux6
Red Hat Enterprise Linux 6 / Oracle Linux 6 (x86, 64-bit), RPM Bundle 5.7.17 448.5M
Download
(mysql-5.7.17-1.el6.x86_64.rpm-bundle.tar) -
解压: tar -xvf mysql-5.7.17-1.el6.x86_64.rpm-bundle.tar
-
检查是否已安装:rpm -qa | grep mysql
-
卸载已安装:rpm -e --nodeps mysql-libs-5.1.73-5.el6_6.x86_64
-
安装顺序 :
rpm -ivh mysql-community-common-5.7.17-1.el6.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.17-1.el6.x86_64.rpm
rpm -ivh mysql-community-client-5.7.17-1.el6.x86_64.rpm
rpm -ivh mysql-community-server-5.7.17-1.el6.x86_64.rpm -
查看默认密码:grep "password" /var/log/mysqld.log
-
启动mysqld服务:service mysqld start
-
设置mysqld服务默认启动:chkconfig mysqld on
-
登陆mysql : mysql -uroot -ppassword(修改成自己的密码)
-
修改默认密码:SET PASSWORD FOR 'root'@'localhost' = PASSWORD('root');
修改字符集:vim /etc/my.cnf ,在[mysqld]下新增一行,添加default-character-set=utf8,保存
若修改密码报错 error 1819(HY000),则是由于当前的密码验证插件validate_password设置的级别过高。运行以下语句修改安全级别:
set global validate_password_mixed_case_count=0;
set global validate_password_number_count=3;
set global validate_password_special_char_count=0;
set global validate_password_length=3;
再修改密码即可 -
登陆mysql,查看字符集:show variables like "%character%";
网友评论