centos6 安装mysql5.77(开发版)

1.

配置yum源:

[root@yyf ~]#rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

[root@yyf ~]#yum-config-manager --disable mysql56-community

[root@yyf ~]#yum-config-manager --enable mysql57-community-dmr

[root@yyf ~]#yum -y install mysql-community-server.x86_64

 

2.初始化数据库:

mysql5.77中是通过mysqld --initialize 来初始化数据库,而不是通过mysql_install_db,如:

[root@yyf ~]#mysqld --initialize --user=mysql --basedir=/var/lib/mysql --datadir=/data1/db3306/  

 

3.登入数据库,5.77中增强了root登入的安全性,在初始化数据库时,就给root生成了一个随机密码,并且登入后强制要求修改密码。

在数据库的错误日志里记录了该随机密码:

[Warning] A temporary password is generated for root@localhost: (6dnJ0gwO+y5

 

[root@yyf ~]#mysql -uroot -p(6dnJ0gwO+y5

[root@yyf ~]#

mysql> status;
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
mysql> SET PASSWORD = PASSWORD('root');
'SET PASSWORD = PASSWORD('<plaintext_password>')' is deprecated and will be removed in a future release. Please use SET PASSWORD = '<plaintext_password>'

mysql> SET PASSWORD = 'root';

 

你可能感兴趣的:(centos6)