安装第二个MySQL实例

 
 
初始化:mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
 
2018-01-18T05:58:45.884088Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 7500)
2018-01-18T05:58:45.884159Z 0 [Warning] Changed limits: max_connections: 214 (requested 1500)
2018-01-18T05:58:45.884334Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-01-18T05:58:48.233856Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-01-18T05:58:48.841004Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-01-18T05:58:49.520955Z 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: a7582fcb-fc14-11e7-8659-00155d03e610.
2018-01-18T05:58:49.608897Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-01-18T05:58:49.676489Z 1 [Note] A temporary password is generated for root@localhost: pOUtFGvl,4jk
 
启动:mysqld_safe --defaults-file=/usr/local/mysql/my.cnf --console
 
连接:mysql -h 127.0.0.1 -u root -P 3307 -p
 
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
 

安装完mysql 之后,登陆以后,不管运行任何命令,总是提示这个

step 1: SET PASSWORD = PASSWORD('your new password');

step 2: ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;

step 3: FLUSH PRIVILEGES;

完成以上三步退出再登,使用新设置的密码就行了,以上除了红色的自己修改成新密码外,其他原样输入即可

 
授权:GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
posted @ 2018-02-01 09:11  yYang365  阅读(385)  评论(0编辑  收藏  举报