版本:社区版 5.7.11
1.采用mysqld --initialize的方式安装数据库
[mysql@host02 bin]$ ./mysqld --initialize --user=mysql--basedir=/db/mysqlmha --datadir=/db/mysqlmha/data
2016-12-09T16:14:41.803286Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2016-12-09T16:14:41.803680Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2016-12-09T16:14:41.803988Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-12-09T16:14:41.804143Z 0 [ERROR] Can't find error-message file '/usr/local/mysql/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2016-12-09T16:14:41.805283Z 0 [Warning] One can only use the --user switch if running as root
2016-12-09T16:14:45.420977Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-12-09T16:14:45.544907Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-12-09T16:14:45.744649Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 99aba79c-be2a-11e6-87c3-080027705c2d.
2016-12-09T16:14:45.767874Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2016-12-09T16:14:45.769002Z 1 [Note] A temporary password is generated for root@localhost: IjNes%oNs7eZ
2.使用初始化密码登陆mysql
./mysql -h localhost uroot -p -S /db/mysqlmha/data/mysql.sock
mysql> show databases;
ERROR 1820 (HY000): Unknown error 1820
mysql> set password=password('mysql');
Query OK, 0 rows affected, 1 warning (0.03 sec)
解决办法就是登陆进去后里面采用set password 的方式修改密码。
阅读(3440) | 评论(0) | 转发(0) |